Secretary of State Alexander M. Haig Jr. today called the Polish crisis "a test case that challenges the credibility of the West" and warned that "the greatest mistake in dealing with heavily armed aggressors is to ignore their violations and act as though nothing had happened."

In a speech to journalists, Haig urged Western Europe to follow up on the action taken yesterday by foreign ministers of the North Atlantic Treaty Organization in setting the stage for possible sanctions against the Soviet Union and the Polish military government.

"Yesterday, we created a clear and united framework for action," he asserted. "Now we must act."

Haig's rhetoric, which included some of his strongest language since the imposition of martial law in Poland, was understood to be aimed at the peace movements burgeoning in Europe and at West European governments that have been reluctant to take the tough line advocated by the United States. Haig stressed the dangers of permitting unchecked Soviet efforts to force communism on others.

"The attempt to ignore this prevailing weakness in Soviet-style communism by resort to force is a source of great danger in the nuclear era. Far from being inconsistent with constructive East-West relations, reform in the East is the basis for greater legitimacy, stability and security throughout Europe."

In answering questions later, Haig angrily chided a British journalist who asked whether the United States is following a double standard by attacking the crackdown in Poland while maintaining friendly relations with repressive dictatorships in the West.

"That's a glib Western cliche, and your whole question is permeated with it," Haig replied. "Isn't it time that our Western critics stopped their double standard. We must stop this masochistic tearing down of our values in comparison to the totalitarianism of the East."

The secretary made a conciliatory bow toward West German Chancellor Helmut Schmidt, whose country has a sizable stake in trade with the Communist Bloc and wants to preserve its special ties with Soviet-dominated East Germany. Schmidt's government initially was reluctant to endorse the possibility of sanctions and did so only after tense talks in Washington last week between the chancellor and President Reagan.

Citing Schmidt's own terms, Haig said: "Stable relations between East and West depend upon what Chancellor Schmidt has called 'calculability.' The Soviets must know that there can be negative or positive consequences, depending on their conduct."

Poland, Haig concluded, "should change our thinking about world affairs." He cited the "failure" of Stalinism in the Soviet Union and the repressions in Vietnam and Cambodia, then asserted, "The greatest danger to the West today may be the tendency to apply different standards to the behavior of the East and West . . . The common sense of our citizens rejects this double standard."

After the speech, Haig flew to Cairo to begin a three-day round of talks with Egyptian and Israeli leaders about their long-stalled talks on autonomy for the Palestinian inhabitants of Israeli-occupied territories.

A senior official traveling with Haig said Haig will assess the views of Egyptian President Hosni Mubarak and Israeli Prime Minister Menachem Begin. He will then recommend to President Reagan possible U.S. actions, such as appointment of a high-level American mediator or a possible mission by Haig sometime in the next few weeks.

For the present, the official added, the U.S. position is one of flexibility and willingness to listen to all suggestions.