Dr. Armand Hammer, flamboyant head of Occidental Petroleum, thought he was doing the nation a good turn, as well as turning a good profit, when he signed a giant fertilizer exchange deal with the Soviet Union six years ago with the blessings of the Nixon administration.

The deal, financed in part by an Export-Import Bank loan to the Soviets, called for Hammer to sell massive quantities of superphosphoric acid, a liquid fertilizer produced in Florida, and to help the Soviets build four big ammonia plants and a big pipeline from central Russia to the port of Odessa. In return, the Soviets gave Hammer exclusive rights to buy Soviet ammonia for the U.S. fertilizer market, starting in 1978.

The arrangement, billed as a 20-year, $20-billion deal, was hailed by the Soviet Union as a breakthrough in U.S.-Soviet trade relations and was endorsed by the Nixon administration.

Now, just as Occidental is beginning to reap the benefits, the U.S. International Trade Commission ruled in a landmark decision yesterday that imports of anhydrous ammonia from the Soviet Union are taking away business from U.S. producers.

The ITC will recommend to President Carter Friday that he impose duties, tariffs or some combination of those penalities to remedy the complaint filed July 11 by 13 U.S. producers and distributors of anhydrous ammonia.

By a vote of 3 to 2, the ITC decided that Soviet ammonia was causing "market disruption" in the United States, a violation of Section 406 of the Trade Act of 1974.

It was the first time the ITC had considered a trade case involving products purchased from the Soviet Union. In the past, the commission had considered four other import cases involving Communist nations -- Poland, Romania and China -- but never the Soviet Union.

According to the complaint filed by the U.S. producers and distributors, imports of Soviet-produced anhydrous ammonia totaled 305,000 short tons in 1978 following zero imports in 1977. Meanwhile, U.S. production declined from 17.6 million short tons in 1977 to 17 million in 1978, the complaint said.

The complaint stated that under an agreement between Occidential Petroleum and the Soviet government, ammonia imports are scheduled to rise to 13 percent of U.S. production in 1980.

After the ITC decides on a remedy Friday, Carter can accept or reject the decision or negotiate an orderly marketing agreement with the Soviets -- the same type of arrangement the U.S. has with Japan, Taiwan and Korea involving imports of color television sets.

A dozen U.S. chemical companies, including W. R. Grace and Union Oil, contended, in effect, that the Soviets are using the Occidental arrangement to dump low-cost ammonia on the U.S. market. This depresses the price, threatens some American companies with collapse, and could leave the United States with inadequate capacity to produce a chemical vitally needed to boost agricultural production, they claimed.

"We have to have our own capacity on something as critical as nitrogen (ammonia) fertilizer," said Phil Potter of Charles Walker Associates, a consultant to the complaining U.S. firms, in an interview. Otherwise, he says, a cutoff of supplies from abroad could retard agricultural production and inflate food costs beyond the current rate.

Potter and other spokesmen for the complainants say the U.S. price of ammonia sold to farmers in the Midwest is $120 or so a short ton, but the companies' average production cost is $125. As a result, many producers are losing money. They contend Occidental can buy ammonia from the Soviets for about $80 a short ton, including shipping costs to Gulf Coast ports, and thus easily undercut domestic producers.

The Ad Hoc Committee, an umbrella organization for the U.S. producers, had asked the trade commission to find that the Occidental imports have caused injury to the U.S. producers and to put a variable tariff on Occidental's imports that would bring the Occidental cost up to $125 for each short ton of ammonia brought in from the Soviet Union. Then, the Ad Hoc Committee says, Occidental's cost of obtaining the ammonia would be the same as the average U.S. domestic production cost.

Dick Cunningham, an attorney here representing Oxy in the proceeding, said, "Occidental fought [the exchange agreement] through the Commerce Department (in 1973), the White House and the State Department, and they put in $400 million and the Russians put in $400 million and then they get hit with this six years late. It's a hard way to do business."

Moreover, Cunningham said, the Ad Hoc Committee price comparisons aren't valid. Oxy officials say they have been paying only around $86 a ton recently for the Soviet ammonia shipped to Gulf ports. But Cunningham said port fees of about $15 a ton, plus shipping fees within the United States and a margin for profit bring the price at which Oxy sells the ammonia up substantially.

So, he said, Oxy isn't undercutting the U.S. market. Moreover, according to Cunningham and James J. Galvin, a high official of Oxy's wholly-owned subsidiary Hooker Chemical, which is handling the ammonia deal, Oxy's imports don't compete in the same market with U.S.-produced ammonia.

U.S. chemical companies, they said, sell largely to midwestern farmers who inject ammonia into the soil to boost corn production by up to 50 percent. Oxy, on the other hand, sells under long-term supply contracts to chemical firms for further processing. Oxy says the U.S. chemical firms in the Ad Hoc Group haven't been offering long-term contracts, so there is no real direct competition.

"The two things we want to get across is that the prices we negotiate with our long-term customers equal or exceed prices being offered by others for similar contract terms and conditions, and that we are concentrating on multiyear fixed-price contracts, not spot sales to farmers," said an Oxy spokesman.

One of the underlying problems in the dispute, according to commodity experts, is that demand for ammonia didn't expand as rapidly as many expected it to expand in the middle 1970s.

At that time, one expert said, there were shortages of ammonia and a great deal of talk about future worldwide food shortages. Spot prices went up to $400 a short ton during one period. As a result, there was rapid expansion of productive capacity here and abroad.

Oxy's Galvin optimistically told the ITC that the demand outlook now is strong again, making it unlikely that imports from the Soviet Union could disrupt the market.

The Ad Hoc Committee isn't buying that argument. It says Occidental's capacity to bring in big ammonia supplies from the Soviet Union depresses the market and robs them of sales.