The Canadian government lined up with members of the Atlantic Alliance today in imposing sanctions on Iran, ording home one of Tehran's two remaining diplomats here.

However Prime Minister Pierre Trudeau reportedly expressed "serious concern" in talks with Secretary of State Cyrus Vance that threatened U.S. military action against Iran could lead to a confrontation with the Soviet Union.

As the Canadians took up the lead of the Europeans, Britain and West Germany announced prompt implementation of the sanctions announced yesterday, and Japan announced agreement "in principle" to follow the Europeans' initiative.

Vance arrived this morning in search of stronger Canadian support for President Carter's policies toward Iran and Afghanistan.

While informed sources said Trudeau showed little enthusiasm for Carter's policies, External Affairs Minister Mark MacGuigan issued an unexpected statement of support aligning Canada with the United States' West European allies.

MacGuigan said that the government gave one of the two Iranian diplomats 72 hours to leave Canada, adding that no more visas will be issued to Iranian students.

Canada closed down its embassy in Tehran two months ago after it engineered the escape of six U.S. diplomats who had taken refuge there.

Today, Canada banned military sales and export credits to Iran. MacGuigan said that the government was urging Canadian companies not to enter into new export service contracts with Iran "until the hostages are released," and that it would be "inappropriate" to buy Iranian oil in current circumstances.

Canada in fact buys no oil from Iran and its trade with Iran has declined from $150 million in 1978 to only a few million dollars this year.

Trudeau has indicated to associates a concern over the overall thrust of U.S. foreign policy since the Soviet invasion -of Afghanistan. U.S. sources said that military steps against Iran contemplated by the Carter administration were discussed in the private session between Vance and Trudeau.

At a news conference, Vance praised Canada's decision yesterday to boycott the Moscow Olympcis. "It is my belief," he said, "that the actions taken by Canada and West Germany will have an important effect on other nations."

From London, Washington correspondent Leonard Downie Jr. reported on European implementation of sanctions:

West German Chancellor Helmut Schmidt announced to parliament an immediate ban on new commerical contracts to supply goods and services to Iran and quick Cabinet action to cut off all existing trade except food and medicine on May 17.

British officials announced they are reducing their embassy staff in Tehran from more than 20 people to four or five and are instructing Iran to cut its delegation here to two or three. The British also said a formal ban on military sales to Iran would stop delivery of three supply ships being built in Britain for the Iranian Navy.

Foreign Secretary Lord Carrington summoned the Iranian charge d'affaires to inform him of this. Then, like Schmidt, Carrington reported to Parliament on the Tuesday decision by the nine-nations of the European Economic Community to impose an embargo on all trade with Iran but food and medicine by May 17 unless "decisive progress" is made toward the release of the American hostages.

The European had decided, Carrington said in his speech in the House of Lords, that "the time had come to find some more concrete far-reaching way of expressing our abhorrence at the continued defiance of the rule of international behavior, and the opinions of the civilized world."

The message of the decisions by the foreign ministers of the European Community, like today's flurry of action here and in Bonn, appears to be aimed as much at the United States as Iran.

European diplomats still indicate they do not believe that tough economic and diplomatic sanctions will help free the hostages. They apparently fear these measures will only add to a siege mentality in Iran and drive it further from the West toward economic dependence on Eastern Europe and the Soviet Union.

Contacts with many European diplomats over the past several weeks indicate that fears of U.S. military measures against Iran and a serious crisis within the Atlantic Alliance were the most impelling reasons why the Europeans made a major shift in policy away from their previous avoidance of a diplomatic and economic confrontation with Iran.

Post correspondent William Chapman added from Tokyo:

The Japanese government agreed to reduce its diplomatic representation in Iran and said it would "in principle" follow the European nations on economic sanctions.

But a government announcement read Thursday morning here did not promise a total trade embargo against Iran if there is no decisive progress by May 17 on freeing the hostages.

A spokesman also said Japan would not force Iran to cut back on its diplomatic representation in Tokyo because the number of diplomats here already is small. The decisions came at a Cabinet meeting with Prime Minister Masayoshi Ohira.

Cabinet Secretary Masayoshi Ito later said the number of Japanese diplomats in Tehran will be reduced by "several." There are 16 there now and according to Japanese newspapers that will be reduced by four or five. There are four Iranian diplomats in Tokyo.

A visa system will be imposed on Iranians wishing to come to Japan, Ito said, and by a process of "administrative guidance" Japan will insist that companies doing business with Iran sign no new contracts.

A major question still undecided is whether Japan will authorize a resumption of construction on a giant petrochemical plant being built in southern Iran by a combination of Japanese companies.