A Virginia defense contractor and three individuals were indicted yesterday by a federal grand jury for allegedly shipping 18 million rounds of defective Yugoslavian ammunition to the Salvadoran Army under a $4.8 million Pentagon-financed contract.

Nordac Manufacturing Corp. of Frederickburg, its president, his ex-wife and an American businessman who worked for the company in El Salvador were charged with various counts of defrauding the U.S. government, lying, conspiracy and obstruction of justice.

Nordac President John P. Straiton IV of Oklahoma City also was accused in the 26-count indictment of giving nearly $500,000 in illegal commissions to the businessman. Straiton also paid for airline tickets for a European trip taken by a top Salvadoran military official and his family soon after his company received the contract, the indictment, returned in Alexandria, charges.

The official, Army Col. Jorge Rivera, was chief of the finance department of the Salvadoran Ministry of Defense and worked with the Salvadoran Buying Commission that purchased military equipment with loans from the U.S. foreign military assistance program.

The charges culminate an investigation begun in 1984 after Salvadoran military officials complained to U.S. officials that their M16 automatic rifles were jamming because the ammunition was found to have a deficient powder charge.

The country's 1983 contract with Nordac for a total of 19 million rounds of ammunition was the first one the Salvadorans arranged directly with an American firm. Until then, all such transactions had been handled through the Pentagon, with U.S. officials ordering the materials.

Under the terms of the Nordac contract, which was approved by U.S. officials, the Salvadoran ammunition was to be made in America; commissions were not to exceed $50,000 and the $4.8 million was to be kept by Nordac in a segregated account. The indictment charges that Straiton violated all these terms of the contract.

Nordac, Straiton, 42, and John P. Fodor, 52, the American businessman living in El Salvador, were charged with conspiracy, fraud, obstruction of justice and making false statements as well as violations of U.S. export, currency and tax laws.

Straiton's attorney, Plato Cacheris, said his client "intends to plead not guilty" when he is arraigned May 30. Fodor's attorney, Jack S. Rhodes, said Fodor is returning voluntarily for arraignment the same day and "as far as I know, has not committed any offense."

Also charged yesterday with conspiracy, making false statements and with the illegal import and export of the ammunition was Straiton's former wife, Darlene R. Straiton, 39, of Fredericksburg, a former vice president and secretary of Nordac. Her attorney could not be reached.

Nordac won the contract with help from Fodor, who is related by marriage to Rivera. A Hungarian emigrant who operates a variety store in San Salvador, Fodor was paid $497,315 in commissions by Nordac, the indictment said. The firm had promised in its Pentagon contract not to pay anyone more than $50,000 in commissions.

The investigation exposed weaknesses in U.S. control over the military aid program. U.S. military advisers in El Salvador gave their approval to the contract with Nordac, although the relatively small firm was then $126,000 in debt to the Pentagon on a previous contract to supply canteen covers that ended in default. Pentagon officials never inspected the ammunition shipments.

In addition, the State Department granted Nordac an export license for the bullets, which were required to be American-made, without checking with the Treasury Department. It had earlier licensed Nordac to import the same kind of ammunition from Yugoslavia.

Straiton and his then wife purchased 18 million rounds of the 5.56 and 7.62 ammunition from the Yugoslavian firm, Unis-Igman. Importing it through Baltimore, the Straitons repacked it in plain boxes in Fredericksburg and exported it through Miami and Baltimore, investigators said.

Straiton told U.S. officials the entire shipment was "Winchester-new" when in fact only 1 million rounds were purchased from Winchester, a U.S. weapons firm, according to the indictment.

It also charges Fodor with failing to file income tax returns for 1983 and 1984, years in which he received $416,315 and $81,000 respectively from Straiton and Nordac in commissions.