TORONTO, JULY 21 -- Candidates of the New Democratic Party won all three special parliamentary by-elections held in Canada yesterday, reflecting the surge in national support for the country's second opposition party shown in recent opinion polls.

The NDP, a self-described social democratic party that is a member of the Socialist International, held one seat and won the other two from the ruling Progressive Conservative Party in the three special votes to fill vacancies caused by resignations.

The by-elections did not significantly affect the Progressive Conservatives' commanding parliamentary majority. The governing party still holds 208 of the 282 seats in the House of Commons. But even members of Prime Minister Brian Mulroney's Cabinet conceded that voters had registered a protest against the government's policies.

Federal Transport Minister John Crosbie told reporters he believed that the election outcome demonstrated the Canadian public was in a "crabby" mood characterized by "vague dissatisfaction."

NDP leader Ed Broadbent hailed what he called "a rather basic change in political attitudes."

Analysts speculated that the longer-term impact of the by-election results might eventually transform national politics into a closer contest among the three strong parties. Although the New Democratic Party has formed provincial governments in western Canada and is the junior partner in a coalition government now in Ontario, it has been only a weak third party in national government.

The party has long advocated government planning and nationalization of Canadian corporations, although party leader Ed Broadbent has signaled his intention to reconsider that position, saying it may be "out of date." Also being reconsidered are the party's controversial defense policies, which call for Canada's withdrawal from the North Atlantic Treaty Organization and other military alliances.

"The image of the party has been determined by its provincial roots," said Ian Mackinnon, president of Decima, one of Canada's leading polling firms. "One of the interesting things about {the NDP's} emergence as a national party is that it's a party which has no national consensus on what it is and what it stands for."

In British Columbia and industrial southern Ontario, the party's strength is in the labor movement and support among university intellectuals. Its roots in the western prairies, however, are in the old social gospel movement led by farmers and clergymen. When in power, NDP governments have begun government health insurance and old-age pension programs that were later extended across the country by Liberal or Conservative governments.

The by-elections were held in Hamilton, Ontario, the Yukon and St. John's, Newfoundland.

Canadian governments since World War II have almost unfailingly lost seats in by-elections, but analysts said the most unusual finding of recent polls and last night's returns is that voters rejected the Liberals, the official opposition party, which, under the leadership of former prime minister Pierre Trudeau, had held power for 16 years before Mulroney's government swept into office in September 1984.