The nation's industrial output declined slightly last month, the government reported yesterday, reflecting the sharp falloff in auto sales during the recent gasoline shortage and possibly the start of the predicted recession.

Meanwhile, in a victory for the administration, the Council on Wage and Price Stability announced that the Amerada Hess petroleum company, which earlier had decided consciously to flout wage-price guidelines, has agreed to comply.

Sources said the turnaround came after a telephone call by Vice President Walter Mondale earlier this month to Leon Hess, chairman of the firm. The council had declared Amerada Hess to be out of compliance, but had not denied it any contrasts.

The figures on industrial production showed the output of factories, mines and utilities fell 0.3 percent in June following a substantial 1.2 percent jump in May that marked a rebound from the April truckers' strike.

Officials said the bulk of the decline was concentrated in the durable goods sector, where production plunged a sharp 3 percent, primarily as a result of a drop in auto assemblies, which fell to a 9.1 million-unit annual rate.

At the same time, however, output in other major sectors of the economy also was lackluster or else declined visibly. Production of consumer goods dropped 1 percent in June after rising 2.2 percent in May.

Output of business equipment edged up 0.2 percent, following a 1.8 percent rise in May. And production of materials declined 0.1 percent in June after climbing 0.8 percent in May.

Yesterday's figures brought he overall index of industrial production to 151.4 percent above its 1967 average. Output levels in June were 4.5 percent above those of a year ago.

The announcement involving Amerada Hess amounted to a psychological victory for the administration. The refusal of one of the nation's large refiners to comply with the guidelines had been a visible embarrassment to the White House.

The company earlier had declined to comply with the guidelines on grounds that its profit margins already were unusually low and that is would be unable to provide needed services to its customers unless it boosted prices further.

The administration technically could have invoked a provision in the guidelines that denies federal contracts to violaters. However, officials were reluctant to do so because of the firm's importance as an oil supplier.

The action came as, separately, council director Barry P. Bosworth warned Congress yesterday there is a "grave danger of an explosion in the underlying rate of inflation" if workers seek higher wage boosts to offset rising energy prices.

Speaking before the congressional Joint Economic Committee, Bosworth said the situation could parallel that of 1974 unless workers exercise moderation in 1979 and 1980.He said the pressures are strong now to ease the wage guidelines.