American military aid to El Salvador -- an issue far from vital to Canada -- is clouding the atmosphere over President Reagan's impending visit to Ottawa.

The government of Prime Minister Pierre Trudeau has been embarrassed in the last week by a spirited attack on its refusal to forcefully condemn the increased shipment of American arms to the small, disrupted Central American country.

The criticism has been so persistent that Trudeau finally told the House of Commons that he would inform Reagan during his visit to Ottawa next Tuesday and Wednesday that increased military aid to El Salvador "is a mistake."

The attack in the House of Commons has come from both the left and the right, led by Ed Broadbent, who heads the socialist New Democratic Party, and Flora MacDonald, who served as secretary of external affairs in the last Conservative government.

Opponents plan to stage a demonstration in Ottawa suring Reagan's visit as a protest against U.S. policy on El Salvador. Prominent politicians like Broadbent many lend their prestige to the demonstrations just the way they did when similar protests were mounted in various cities throughout Canada on Feb. 28.

The Canadian government has made itself vulnerable to opposition heckling by taking the seemingly milquetoast position that, while Canada opposes American military aid to El Salvador, Canada does not intend to make any fuss about it.

Mark MacGuigan, the secretary of external affairs, was criticized sharply in the House of Commons after an Associated Press dispatch quoted him as telling reporters in New York last Feb. 4, "I would certainly not condemn any decision the United States takes to send offensive arms there . . . . The United States can at least count on our quiet acquiescence." MacGuigan protested that the reporters had misquoted him. He claimed that he had said that the United States could count on Canada's quiescence, not acquiescence. This distinction, however, was mocked by his critics.

It is not clear, of course, whether the issue of El Salvador will have a significant role in the talks between Trudeau and Reagan. Canada has a host of perennial contentious matters to raise, including the fisheries treaty that is stalled in the U.S. Senate, the auto pact that seems now to be benefiting the United States more than Canada, and acid rain pollution that flows from the United States. American officials have a new contentious matter of their own -- the new Canadian energy policy that discriminates against foreign oil companies.

But these tend to be dull issues. Trudeau, who prides himself on his sophistication in foregin affairs, may prefer to leave a large part of these somewhat mundane matters to lesser officials and concentrate far more on discussing a whole range of international issues with Reagan, including the problem of El Salvador.

Trudeau already has promised to bring up a second foreign issue -- his proposal for a North-South summit conference in Mexico this June, bringing leaders of industrialized and developing countries together to discuss the problem of economic growth in the Third World. MacGuigan raised the matter recently with Secretary of State Alexander Haig but received no promise that the United States would attend.

American diplomats in Ottawa have evidently been surprised by the extent of Canadian concern over U.S. policy in El Salvador. At the recent annual meeting of the Conservative Party, for example, some American officials, expecting the usual questions about fishers and energy, found instead that questions about El Salvador dominated a seminar on U.S.-Canadian relations sponsored by the party's youth wing.

By Canadian standards, the demonstrations have been impressive. In a pelting, freezing rain last Tuesday, 400 protesters marched past the U.S. Embassy several times and then assembled on the steps of the Parliament buildings to hear several speakers, including Broadbent, condemn American policy. Broadbent, in fact, defended the right of the Salvadoran rebels to take their arms from communist sources since, in his view, there was no other way for them to overthrow a repressive regrime.

In Montreal, where a good deal of interest has aroused by critics of American policy within the Roman Catholic hierarchy, 1,200 protesters marched past the American Consulate there. Similar through smaller demonstrations took place in Toronto, Vancouver, and Regina.

It is obvious that U.S. policy on El Salvador is raising many Canadian fears about Reagan's leadership and stirring many Canadian memories about the Vietnam war. Most analysts of U.S.-Canadian relations agree that the war in Vietnam shocked many Canadians into losing their confidence in American leadership in world affairs.

At a luncheon with foreign correspondents last week. MacGuigan outlined, in a good deal of detail, the Canadian position on the problems of El Salvador.

"When it's a question of arms shipments," he said, "our position is one of opposition to the shipment of the offensive arms, either by ourselves or by other countries, to states which are in a situation of internal disorder.

"Beyond that," he went on, "I don't think anyone should look to us for profound insights on what is happening in El Salvador or what should be done. It is not an area of vital interest to Canada. It's not an area in which we feel any commitment to solve the problem."

As evidence, MacGuigan noted that Canada does not even have an ambasador there. Canada's information about El Salvador, he said, come from newspapers and from the reports of other countries.

"We don't know, for instance, if anyone does, but we less than most, to what extent the junta is responsible for right-wing violence which is occuring, to what extent it could control it, if it wished.

"We don't know to what extent the rebel movement is controlled by communists," he went on. "So we're taking what is, in effect, a very modest position." MacGuigan said, "And it's because we're taking a modest position that we are being attacked politically."

The position, however, is so modest as to expose the federal government to ridicule within Canada, especally with the Reagan trip so close. The political cartoonist of the Ottawa Citizen recently drew a gigantic Secretary Haig, in a bemedaled general's uniform, extending an enormous hand to clasp the neck and shoulders of a tiny MagGuigan. "Now, have you got it straight about El Salvador, MacGuigan?" the general asks.