Three big natural gas pipeline compressors left France on a ship bound for the Soviet Union yesterday in defiance of President Reagan's anti-pipeline embargo, and the United States immediately responded by invoking trade sanctions against two firms involved in their shipment.

The Commerce Department announced that Dresser France, a wholly owned subsidiary of Dresser Industries of Dallas, and Creusot-Loire, a French government-owned industrial giant, are being prohibited from importing any U.S. goods, services and technology until further notice.

Commerce Secretary Malcolm Baldrige called the action "a measured response that we hope will dissuade other firms from violating U.S. regulations."

But a British firm, John Brown Engineering Ltd., is planning to ship to the Soviet Union early next week turbines made with U.S. components, which also would violate Reagan's embargo against use of U.S. technology in building the pipeline to carry natural gas from Siberia to customers in Western Europe.

West German and Italian firms are likely to follow suit, also risking American retaliation, which would place the United States in legal and political confrontation with its four major allies in Western Europe. The London Times said in an editorial yesterday that the pipeline dispute has "torn a nasty hole in the western alliance."

In an effort to contain the damage, White House and State Department spokesmen went out of their way yesterday to argue that the overall relationship between the United States and France had not been affected by the dispute or the U.S. retaliatory steps.

State Department spokesman John Hughes called the actions against Dresser France and Creusot-Loire "very specific" steps that are being applied to "the specific instance" at hand. He said these sanctions would set a pattern for the handling of future violations of Reagan's anti-pipeline embargo.

Washington Post correspondent Peter Osnos quoted a senior official in London as saying, "There is no sign detectable anywhere that either side is prepared to back down . . . . This is a wound still being created, rather than a wound starting to heal."

No progress was reported in transatlantic consultations to reconcile the opposing positions, perhaps through a special U.S. mission to Europe. Officials here said any formula for ending the confrontation probably would have to include an overall tightening of western economic measures against the Soviets. This indicates that Reagan would not accept a disguised retreat from his anti-Soviet stand in the interest of unity within the NATO alliance.

Vice President Bush, defending the administration's position in a speech to the American Legion convention in Chicago, said, "We've heard a lot of protests from our European allies. I'm sorry. The United States is the leader of the free world and under this administration we are beginning once again to act like it."

If the Soviets want their trade with the United States restored, Bush said, they should lift their repression in Poland.

Reagan, who long opposed the Soviet-Western Europe natural gas pipeline for strategic reasons, banned U.S. companies from participating in the project last December in retaliation for the Soviets' role in the imposition of martial law in Poland. Reagan extended his embargo June 18 to cover the overseas affiliates of U.S. firms and all companies using American-licensed components or technology.

The European nations involved, which had consistently said they would honor their previous contracts and commitments to the immense pipeline project, rejected Reagan's June decision and took or announced various steps to get around it.

In the case of the Dresser compressors, the French government "requisitioned" the equipment from Dresser France under French law. The compressors sailed out of Le Havre on a French ship, the Borodine, just after noon yesterday (Washington time) bound for the Soviet port of Riga, a 10-day journey. About two hours later the Commerce Department announced its retaliation against Dresser France and Creusot-Loire, the prime French contractor for the pipeline project.

The National Association of Manufacturers, in an early indication of the reaction by U.S. industry, said in a statement that "it makes little sense for the U.S. government to penalize a foreign subsidiary of an American company for obeying the laws of the nation in which that subsidiary is incorporated and operates."

Dresser Vice President Edward R. Luter told Washington Post correspondent Dan Balz in Dallas that his company was "amazed" by the Reagan administration's action against its subsidiary, which he said could have damaging long-term effects on Dresser France, its employes and their families. Luter said Dresser is appealing the order to the Commerce Department, which may be the first step toward a court suit.

V. Rock Grundman, the company's general counsel, said "the decisions to ship the pipeline equipment were not made by Dresser or Dresser France. The decisions were made by the French government."

The decision to take "measured civil penalties" against Dresser France was made in a meeting here Tuesday chaired by Secretary of State George P. Shultz and attended by Baldridge, Secretary of Defense Caspar W. Weinberger and other senior officials. It was later approved by Reagan, who is vacationing in California.

Strong as they are, the sanctions do not include criminal penalties against the companies or their officials, nor any action against the parent U.S. firm or against the government of France. All those possibilities were reported to have been considered and rejected.

Undersecretary of Commerce Lionel H. Ulmer said the decision to also apply sanctions against Creusot-Loire was made after the government received new information Wednesday that the French industrial giant is a party to the contract between Dresser France and the Soviet pipeline consortium.

Ulmer, describing Creusot-Loire as the prime contractor for France on the project, told a news conference, "we have reason to believe they aided, encouraged and abetted the shipment of compressors en route to the Soviet Union."

By blocking export of all U.S. products, services and technology to Creusot-Loire, the Reagan administration is taking a potentially damaging step against one of Europe's leaders in nuclear energy equipment production and other heavy industry with 1980 revenues of $3.8 billion. The firm has about 12 subsidiaries in the United States that would be affected, officials said.

"We're talking about everything," Ulmer said of the ban on all U.S. exports to either of the blacklisted firms. He said it would be enforced by the U.S. Customs Service at American ports, among other means.

The Commerce Department announcement described the blacklisting of the two firms as "temporary denial orders" while the department investigates their role in violating Reagan's orders under the U.S. Export Administration Act. But Ulmer said the sanctions will be imposed indefinitely while the investigation continues.

Questioned by reporters about self-inflicted damage to the commercial and political interests of the United States and to the Atlantic alliance, State Department spokesman Hughes said Reagan and Shultz recognize that the strong stand "causes difficulties for ourselves and our allies and for American business."

This fact "simply underscores the strength of the president's position" of abhorrence of Soviet behavior, especially the martial law in Poland, Hughes said.