Prime Minister Margaret Thatcher said today that the use of retaliatory or preemptive strikes against another country to punish or prevent terrorism was "against international law" and a policy that could lead to "a much greater chaos."

While she noted that "terrorism is also against international law," Thatcher said, "I believe that one has to fight it by legal means."

Thatcher's comments, made during an interview with London-based American correspondents, came in response to suggestions that the Reagan administration has not ruled out such retaliatory action against Libya for its alleged involvement in last month's terrorist attacks in Rome and Vienna in which 19 persons died.

Libyan leader Muammar Qaddafi indicated yesterday in Tripoli that he believed the United States might launch a military raid against his country, and he threatened his own retaliation with attacks against Western European ports that harbor U.S. warships, or cities near U.S. military bases.

In today's interview, Thatcher also strongly repeated her belief that economic sanctions in pursuit of foreign policy goals "don't work" and said she did not think there was "any possibility of getting the whole of Europe to agree to sanctions" invoked by Reagan this week against Libya.

U.S. allies have reacted coolly thus far to Reagan's appeal to join the sanctions. Italian Prime Minister Bettino Craxi yesterday said no Italian workers would be allowed to take jobs in Libyan businesses abandoned by U.S. enterprises as a result of the sanctions. In West Germany, Chancellor Helmut Kohl has declined to answer the sanctions call on the ground that it does not conform to German national interests.

Canadian Prime Minister Brian Mulroney announced that his country will suspend government aid to Canadian businesses in Libya. The restrictions, however, fell short of the sanctions sought by President Reagan.

Secretary of State George P. Shultz said yesterday that Deputy Secretary of State John C. Whitehead would visit Europe next week to try to persuade NATO allies to join the effort. Today, European Community foreign ministers said they would meet in The Hague on Jan. 21 to discuss the U.S. request and new measures to combat terrorism.

Thatcher has strongly supported increased international cooperation against terrorism, and Britain has been the victim of repeated terrorist attacks, primarily by the Irish Republican Army but also on at least one occasion from Libya. But her remarks today amounted to unequivocal rejection of sanctions and more direct retaliation as viable diplomatic weapons.

She said her government would receive and consult with Whitehead, but she gave no indication that she would change her mind.

"Look," Thatcher said, "you do not have to tell me about Libyan terrorism. We saw it on our streets -- the murder of a policewoman by shots fired from the Libyan Embassy" here in April 1984. "We broke off diplomatic relations, you will recall. We have not restored diplomatic relations since then. We ceased to supply defense equipment to Libya. Now, we have not gone further than that, and we do not intend to go further than that, because . . . sanctions don't work."

"They only work," she added, "if they're adopted 100 percent and, alas, I don't know any case in which they have been."

"What else does work?" she asked. "One has to try to get at those people who supply the armaments . . . . I wish in many ways that we could all get together against nations which have terrorist camps and practice terrorism and supply armaments to terrorism. I see at the moment no possibility of that."

Thatcher stressed what has been a constant theme of her foreign policy, the need for "a wider settlement of the Middle East problem" and the possibility of "negotiations between [Jordan's] King Hussein, the Palestinians and the Israelis" within "an international context." The U.S. initiatives begun last year by U.S. Assistant Secretary of State Richard W. Murphy, she said, "have not been pursued to their logical conclusion."

Thatcher declined to respond to specific questions concerning the resignation yesterday of Michael Heseltine as defense secretary in a dispute over the future of Britain's Westland Helicopters. In an opening statement, she said, "We are sad to lose the defense secretary through resignation. We shall now have to put this behind us."

On the larger issue behind the Heseltine incident -- whether Britain's defense manufacturing capacity should be more closely aligned with Europe or the United States -- Thatcher said, "We are very keen on collaborative projects" in Europe.

On other issues, Thatcher made the following points:

*She said the recent U.S.-Soviet summit had shown that Reagan and Soviet leader Mikhail Gorbachev "can do business together."

*Both her government and that of Irish Prime Minister Garret FitzGerald had found that "the reaction was much stronger than we thought it would be" among militant Protestants opposed to the recent Anglo-Irish agreement on the future of Northern Ireland. She pledged to do whatever is necessary to prevent a complete breakdown of order in the province.

*Thatcher said she and French President Francois Mitterrand, reportedly at odds over several proposed schemes for a fixed rail or road link across the English Channel, still have come to no decision.