The Internal Revenue Service has recommended reversing a 22-year-old ruling that has allowed big U.S. oil companies to escape billions of dollars in taxes on their foreign earnings.

However, the IRS recommendation reportedly is meeting stiff opposition from Treasury Secretary W. Michael Blumenthal, who must make the final decision on whether to go along it.

Blumenthal is said to fear that the move would damage the Carter administration's relations with business. The royalty "loophole" has been a major target of liberals for several years.

There was no reliable estimate of the economic impact that would result from reversing the ruling. Treasury projections showed the move could cost the oil companies $1 billion a year in extra taxes.

Tax experts said they doubted the oil companies would have to pay much of this because oil-producing countries probably would alter their tax laws to circumvent a reversal of the ruling.

Nevertheless, a reversal of the ruling would close one of the last major avenues by which oil companies can claim huge tax breaks as a result of foreign operations. The industry has thwarted several previous attempts to end it.

The IRS proposal recommends that the change apply only to future royalties paid by U.S. oil companies. It would not require repayment of $6 billion in back taxes for credits claimed over the past seven years.

Details of the proposal emerged after the IRS refused yesterday morning to disclose its recommendation to a congressional subcommittee, setting off warnings of a possible subpoena.

Rep. Benjamin S. Rosenthal (D-N.Y.), chairman of the House Government Operations consumer affairs subcommittee, threatened to subpoens the recommendation if it were no made public by the start of the next session.

However, Jerome Kurtz, the commissioner of internal revenue, insisted that the measure still was an internal Treasury document and that it would be "disruptive" to disclose it. The details came from other sources.

Ironically, the IRS recommendation comes at a time when changes in U.S. tax laws - and in the ownership structure of the overseas oil-drilling operations - already have cut deeply into oil company tax breaks.

In the first place, Iran and other major oil-producing countries have nationalized their petroleum facilities, leaving only a handful of nations still charging royalties to American companies.

The two major producing nations that could be affected if the IRS proposal is adopted are Saudi Arabia and Libya. However, Saudi Arabia is a major producer, with substantial market power in the oil cartel.

Recent changes in U.S. tax laws have limited the tax breaks available in the form of foreign tax credits to 50 per cent of the taxs (or royalties) an oil company pays, and denied some other breaks previously allowed.

Analysts say the real question is when changes, if any, Treasury makes in the payments that it counts as income taxes in connection with oil company operations. Confining the change to the royalty issue wouldn't make much difference, one expert asserts.

The IRS recommendation came in response to a petition filed by Tax Analysts and Advocates, a "reform" group here. The organization also has filed suit over the issue.

Kurtz told the subcommittee yesterday that Blumenthal is expected to announce a decision on the controversy by January. The secretary also has opposed ending other foreign tax breaks for U.S. corporations.

Under the foreign tax credit provision in present law, oil companies may offset their U.S. tax liability by the full amount they pay in income taxes to foreign governments. Since 1955, royalties have been counted an foreign taxes.

The effect of the new IRS proposal would be to restore the pre-1955 treatment of royalties as business expenses, which are deductible but are worth less to a company than a tax credit, which pares total tax liability directly.