America's European allies, while promising to help the United States carry out the spirit of economic sanctions against Iran, also have told Washington that legal problems may limit the trade and financial steps they can take, a senior State Department official said yesterday.

The official, who declined to be identified, said this message was given to Deputy Secretary of State Warren M. Christopher during his talks in Europe this week with representative of the 15-nation North Atlantic Treaty Organization.

According to the official, Christopher was told that the Soviet Union's veto of a U.N. Security Council resolution decreeing sanctions against Iran had left many West European governments unclear about how much legal power they have to halt trade and financial dealings between their countries and Iran.

The official insisted that the allies remain strongly supportive of U.S. efforts to force Iran to release its American hostages. He also said the Europeans had promised to study the legal problems involved and institute those sanctions that are permitted by their respective national laws.

Despite the official's effort to stress the continued solidarity between Washington and its allies on the hostage question, his comments raised questions about whether the Europeans are revising their thinking on Iranian sanctions in the wake of the parallel crisis caused by the Soviet invasion of Afghanistan.

In discussions with major West European leaders last month, Secretary of State Cyrus R. Vance won their general agreement to cooperate with the United States in putting a trade and credit squeeze on Iran.

However, that happened before the Soviet intervention in Afghanistan, and at a time when Washington had grounds for believing the Soviet Union would not block a Security Council resolution on sanctions.

More recently, there have been persistent reports from Europe that many NATO leaders now believe that efforts to strengthen the West's influence in the predominantly Islamic Persian Gulf and Southwest Asia region could be hindered by overt western pressures on Moslem Iran.

In addition, the Europeans told Vance last month that their ability to apply sanctions would be enhanced greatly if they had the authority of a U.N. resolution.

Most of these countries have statutes similar to a U.S. federal law, the United Nations Participation Act, which gives the president authority to enforce Security Council decisions. In the absence of a council resolution, President Carter can still impose sanctions by resorting to other laws giving him emergency powers.

However, the senior official noted, the European governments do not have a similar fallback and, in many cases, would not have authority to restrict their banks and exporters from dealing with Iran without having special enabling legislation passed by their parliaments.

British Prime Minister Margaret Thatcher has said publicly that it would be extremely difficult, if not impossible, for her government to obtain such legislation. The same problem also exists in most other NATO countries, including West Germany, Western Europe's principal industrial and exporting nation.

Nevertheless, the senior official, contending that the United States still expects a high degree of cooperation from the allies, said clarification of the specific measures they will take against Iran should start coming out of the various European capitals within the next few days.

He added that the Carter administration, which has announced its intention to apply all the sanctions specified in the vetoed U.N. resolution, will begin putting them into effect shortly. These are to include an embargo on all exports to Iran except food and medicine, severe restriction of transportation links with Iran and a cutoff of credit and financial assistance.

In another development, Carter yesterday urged Thomas Gleason, head of the nation's largest dockworker union, to end a nine-day boycott of grain shipments to the Soviet Union.

Gleason said he would reply after consulting with the executive board of the International Longshoremen's Association.

Carter said the boycott has snarled ship traffic and is hurting farmers. The ILA action has prevented the shipment to the Soviets of 3 million metric tons of grain not affected by the president's partial grain embargo. (A metric ton is 2,200 pounds.)

Also yesterday, the State Department said that U.S. Ambassador Thomas Watson, recalled after the Soviet invasion of Afghanistan, will return to Moscow today, and that Soviet Ambassador Anatoliy F. Dobrynin, absent from Washington since early December, will arrive back here today.

Department spokesman Hodding Carter said of Watson's return, "We believe his presence is needed in Moscow to convey the strong views of the president and Secretary Vance to the Soviet leadership . . . We want the Soviets to understand at first-hand how serious a reevaluation of our relationship has taken place here."

The senior official reiterated Christopher's view previously expressed by him in Europe, that the NATO allies share the U.S. determination to make the Soviets pay "a high price" for Afghanistan and have promised "not to undermine or undercut" the U.S. embargoes on grain sales, high-technology exports and commercial credit to Moscow.

However, the allies, led by France, West Germany and Italy, did not agree to reduce significantly their own existing trade with the Soviets. That has created considerable speculation about the degree to which the West Europeans are willing to go beyond the surface solidarity of strong words and symbolic gestures to isolate the Soviets from western trade and technology.

The official also said Christopher had found strong interest among many West European governments in taking the Olympic games from Moscow this summer. Although he emphasized that no decisions have been made about a boycott, the official said Christopher had heard considerable discussion about the possibilities of moving the games to another city, postponing them or dividing the various events among a number of countries.