Continuing sharp differences between the United States and its Western European allies over East-West trade policy and farm export subsidies are again raising transatlantic tensions and darkening hopes for a successful western economic summit in Williamsburg, Va., in May.

The Reagan administration, as host for the seven-nation meeting, would like to avoid the squabbles that marred last year's summit at Versailles and demonstrate unity in the alliance at a time when massive protests may gather momentum against the West's planned deployment of nuclear missiles in five European countries later this year.

But disagreements over the nature of East-West trade and agriculture seem so intractable that the summit may become an exercise, as a western ambassador here puts it, of "trying to hold our nose and survive it."

Nearly three months after President Reagan cooled the controversy over the Soviet gas pipeline by lifting sanctions against companies involved in the project, the allies remain far apart on the issues of controlling credit and high-technology exports to the Soviet Union.

In the wake of the pipeline fiasco, several studies were commissioned to prepare the ground for a joint trade policy in time for the Williamsburg summit.

The North Atlantic Treaty Organization is looking into the strategic dimensions of trade with the Soviet Union while the Organization for Economic Cooperation and Development is studying dependence of the allies on Soviet gas.

A third group, the Paris-based Coordinating Committee for Multinational Export Controls, or COCOM, is seeking ways to control the spread of high technology and prevent sophisticated equipment from going to the Soviet Union.

U.S. and European officials also expressed concern that a growing conflict over subsidies to dispose of butter, wheat and poultry surpluses accumulated by American and European farmers could become so tense by May that talk of a trade war could dominate the summit.

Faced with record foreclosures of U.S. farms and angry demands for action by congressmen, the administration has started to retaliate against the Europeans for selling farm products below world market prices.

Last week the United States angered the Europeans by undercutting them with a subsidized sale of 1 million tons of wheat to Egypt, one of the community's traditional markets. If the United States carries the price war into butter or other goods, European officials warned that some punitive action may be taken against $4.5 billion worth of soybeans and other U.S. farm products that enter the community duty free.

Leonard Doyle of The Guardian reported that Edith Cresson, the French agriculture minister, said the community would sell subsidized farm produce to Latin American countries if the United States went ahead with a planned sale of subsidized butter to Egypt.

During his trip to Europe in December, Secretary of State George P. Shultz sought repeatedly to portray the breach with Europe as having been closed and exhorted the allies to work intensively for a joint approach to East-West trade that could be sealed at the May summit.

A U.S. diplomat closely involved in the preparations said, however, that even though one or two studies might be completed by that time, "It will take at least a year to achieve anything close to a common policy, and then only if the administration settles for far less than it has demanded of the Europeans."

Reagan's decision to drop sanctions in the pipeline dispute represented "a magnificent band-aid," said an ambassador, "but real differences over East-West trade have not been resolved."

The Europeans, while willing to restrict the flow of goods that carry obvious strategic value, insist that normal trade and financing arrangements with the Soviet Union should not be curtailed. Such restrictions, they argue, would not only cut off important export markets for European companies battered by a prolonged recession but also amount to declarations of economic warfare against a powerful neighbor.

The Reagan administration favors much stricter control of commerce with the East Bloc and says a variety of consumer goods may unwittingly serve the purposes of the Soviet military buildup.

The Europeans counter with the argument that by such a yardstick, U.S. grain sales to the Soviet Union also provide important assistance to Moscow's military planning.

"The big problem is definition," says a European Community official. "Who is going to tell us vacuum cleaners cannot be sold to the Soviets but wheat can?"

Even if the studies are finished by May, U.S. and European Community officials said they were highly dubious that any policy action would be taken at the Williamsburg meeting.

"We know that Reagan clearly wants a different meeting than Versailles, with less words and more business to reach a meeting of the minds," said a European involved in the summit preparations.

"But it's difficult to see how there can be concrete achievements. We think Reagan is aware of this and will settle for a friendly, low-key meeting, with maybe a few small steps to show we are working together."

Despite the anxieties over East-West trade and farm subsidies that could sour the atmosphere of the summit, U.S. and European diplomats said that some lessons were learned by the failure of last year's summit that might be avoided this time.

"Everybody agrees that the format followed at Versailles was simply terrible," said a European Community official. "There should be fewer prepared texts, no prearranged communique and more substantial discussions among the government leaders. Maybe we are learning that these meetings are just not capable of solving delicate world economic problems."