A House Foreign Affairs subcommittee, in an attempt to overturn controversial Reagan administration trade sanctions that have angered European allies and American businesses, yesterday approved a bill that would repeal the administration's ban on sales of oil and gas equipment and technology to the Soviet Union.

By a 5-to-2 vote, the international economic policy and trade subcommittee approved a bill that would overturn both last December's ban on such sales by American companies and a June extension of that prohibition to cover overseas subsidiaries of U.S. firms and non-American companies producing equipment, primarily for the Soviet natural gas pipeline, under U.S. licenses.

The repeal, however, leaves intact President Reagan's power to impose such trade sanctions, so that he could simply readopt identical measures even if the bill were to win congressional approval and escape presidential veto.

The administration's trade sanctions, designed to delay the pipeline to Western Europe in retaliation for the Soviet-backed crackdown in Poland, have outraged American firms, which stand to lose an estimated $1.2 billion, and European allies, three of which have ordered their companies to defy the latest sanctions.

"It's a failed policy," said Rep. Paul Findley (R-Ill). "The administration has painted itself into a tight spot" with its closest allies, he said, by its "rather crude efforts to whip them into compliance" with American attempts to block the 3,500-mile pipeline.

"This won't hurt the Soviets very much," added Rep. Millicent Fenwick (R-N.J.). "I think we ought to be tough in ways that really hurt them, not that hurt us and our people."

Arguing in support of the sanctions, Undersecretary of State James L. Buckley said that while the June extension "obviously concerns our allies and affects our relationships with them, Reagan took those considerations into account in coming to his decision" and concluded that "the costs of U.S. inaction simply outweighed the sacrifices that we would have to make to bring home to the Soviets our seriousness of purpose."

In the month since the new sanctions were announced, Buckley said, "We've already seen a toning down of the rhetoric" from allies opposed to them.

But former undersecretary of state George W. Ball, who also testified before the subcommittee, cautioned that "Europe's outrage should not be underestimated." Ball urged Congress to overturn the sanctions rather than let the administration "blunder on and turn an act of stupidity into an act of disaster."

Yesterday's bill, sponsored by Rep. Don Bonker (D-Wash.) and Findley, would not take away the president's underlying authority, under the Export Administration Act, to impose trade sanctions. Rather, it simply would specifically overturn the December and July prohibitions, a move subcommittee members said was within Congress' power since it had given the president the authority to impose the sanctions in the first place.