Poland threatened today to withdraw from the Madrid follow-up conference of the Helsinki agreement if Western governments proceed with plans to use the meeting next week to attack Warsaw's imposition of martial law.

In an interview with the official Polish news agency published today, Poland's deputy foreign minister, Jozef Wiejacz, said his country would not take part in the conference if it takes on what he described as a character of confrontation and outside interference in internal Polish affairs.

"We are not going to face any self-appointed tribunal," Wiejacz, the former number two Polish diplomat in Washington, said. "We shall not participate in conferences in which Poland is made to stand in the dock. We cannot agree to using Polish problems for further poisoning of the international atmosphere and escalation of tension."

As part of a coordinated Western response to the Dec. 13 crackdown in Poland, NATO governments have agreed to send their foreign ministers to the Madrid meeting, beginning Tuesday, to lodge formal protests with Warsaw authorities charging violations of the 1975 Helsinki accords. The Madrid conference is being held to review compliance with the Helsinki agreement in which 35 nations formally recognized Europe's postwar borders and declared that they would respect human rights.

In a related development, Poland's official press today condemned Britain's announcement yesterday of sanctions against Poland and the Soviet Union, calling the measures "another brutal interference in the internal problems of our country and the Soviet Union."