Britain defied the Reagan administration's ban on the sale of U.S.-licensed equipment for the Siberian gas pipeline today, ordering four British-based companies to fulfill their contracts as suppliers.

Three of the companies are subsidiaries of American corporations. By invoking the 1980 Trading Interests Act, Trade Secretary Lord Cockfield sought to compel them to follow British rather than U.S. law.

Cockfield's action reversed the British position outlined last week. Officials said then that while the government would support companies that ignored the embargo, it would not order non-compliance. U.S. officials have said the embargo's purpose is to put pressure on the Soviet Union to bring out easing of martial law restrictions in Poland.

Britain is the fourth Western European country to oppose the ban. France and Italy have said they would defy it, and West Germany has been encouraging its companies to go ahead with existing orders.

"The government has no wish to escalate this dispute but needs to protect Britain's trading interests," Cockfield told the House of Lords. Officials said later that more than 2,000 jobs would be lost if the embargo were obeyed.

Cockfield last month issued a warning that the Trading Interests Act might be invoked, saying, "The application of American law outside United States jurisdiction is unacceptable."

One government official commented, "We were baring our teeth then; today we have bitten."

[The State Department said it was studying the British move, Reuter reported. The agency quoted a U.S. official as saying, "We regret any action that would weaken the pressure on Polish authorities to relax significantly their martial law measures."]

Cockfield's decision was the first under the trading act, which carries a fine of up to $1,750 and possible jail terms for violators.

"The companies have got no option," the official said. "They have got to go ahead. Our legislation is overriding."

Of the four companies involved, only John Brown Engineering of Clydeside is British-owned. Smith International (North Sea), Baker Oil Tools (UK) and AAF Ltd. are subsidiaries of American companies.

John Brown is committed to supplying 21 turbines designed by General Electric and spare parts worth about $182 million.

British-based companies have a total of about $340 million in orders for the 3,500-mile pipeline that will carry natural gas to Western Europe.

John Brown Engineering has made no provision in its accounts for termination of the deal, one of its biggest current contracts.

The subsidiaries may face a legal tangle over their position, experts said, with disputes over whether they come under British or American law.

British Prime Minister Margaret Thatcher's attitude has been a mixture of opposition to the U.S. embargo and hope that the Reagan administration would change its mind. She said that contracts made in good faith should be honored and told the House of Commons recently, "The question is whether one very powerful nation can prevent existing contracts being fulfilled. I think it is very wrong to do that."

Cockfield said he still hopes for an acceptable solution, but added that the Reagan administration had not responded to efforts of the British government. In these circumstances, he said, the government had decided that Britain's trading interests made it necessary to forbid the four companies to obey the embargo.

Britain, along with its Western European allies, is also irritated that the Reagan administration is extending its agreement to sell grain to the Soviet Union while it is telling Western Europe not to sell pipeline equipment. Cockfield described this situation as "quite inequitable."

The pipeline dispute deteriorated sharply as a second transatlantic trade disagreement, over steel, was coming to a climax.

Britain, along with France, Belgium and Italy, faces new U.S. duties of up to 40 percent on Aug. 24 on sales of steel, imposed by the Reagan administration to protect U.S. producers.