LONDON, NOV. 16 -- Prime Minister Margaret Thatcher tonight called on U.S. policy makers to heed her example of raising taxes when necessary to cut budget deficits and said such cuts must be "sufficient to restore confidence, clearly and decisively."

Noting that President Reagan and Congress "are still negotiating" over the deficit, Thatcher implied they should ignore "contradictory advice from their own economists," some of whom have warned that tax increases would lead to recession.

Thatcher's comments, in a speech to leading financiers at the annual banquet of the Lord Mayor of London, were the most specific yet in a series of public statements over the past several weeks urging the Reagan administration to take decisive action to reduce the U.S. budget and trade deficits.

As Reagan's closest international ally and a fellow conservative, Thatcher, according to her aides, has tried repeatedly over the years to impress on him the need to balance the U.S. budget, no matter what the short-term political cost. She and other allied leaders have been closely following the intense negotiations in Washington, which they see as crucial to reversing the international economic crisis that began with the Oct. 19 stock market plunge.

Thatcher noted that "the current situation cannot be laid only at America's door." Among the other causes, she cited persistent Japanese and West German trade surpluses that have been sustained, particularly in the case of Japan, by protectionism.

"The principle of free trade," she said, "must be fairly applied . . . . No country should seek to run its economy and society in such a way as to entrench a massive and permanent trade balance in its favor."

Countries with large trade surpluses have a "special responsibility," Thatcher said. "Germany and Japan have, I believe, scope to expand their domestic economies without the risk of higher inflation."

President Reagan was to be congratulated, she said, for his "strong and determined opposition to the protectionist measures which are currently before Congress."

For Thatcher, perhaps more than other Western European leaders, the restoration of financial confidence around the world has significant political implications.

Although her government enjoys a massive parliamentary majority and remains significantly ahead of its opposition in public opinion polls, Thatcher is not well-liked in Britain. Lacking a reservoir of public affection, Conservative Party strategists are aware that her success depends largely on an image of managerial competence that could be undermined by the actions of other countries.

Thatcher herself is among the most ardent believers in her ability to successfully manage the nation's pocketbook, and her speech tonight recounted Britain's economic success under her stewardship. But, she acknowledged, "in today's world economy, it simply is not possible for any country to keep dry while the rest get wet."

With global markets and trade, "every major country must be prepared to take the necessary action to secure a sounder balance in the world economy," Thatcher said.

She spoke of "damaging distortions" in world trade, caused by countries competing with one another to give ever bigger agricultural subsidies, often with consequences that "are absurd -- out of all proportion." For example, she said, farmers in Japan were being paid eight times the world price to grow rice. In Iowa, farmers this year will receive more loans and other aid from Washington than all the nations of Africa get from the World Bank.

"And in Europe, believe it or not," Thatcher said, "the subsidy for every cow is greater than the personal income of half the people in the world."

Although she did not offer specifics, Thatcher said that "we in Britain stand ready to do our part . . . to help restore stability to financial markets and to maintain the conditions for continued growth."

Regretting the current crisis, Thatcher returned to a familiar theme -- that if all the world's economies were run as she has run Britain's since 1979, the problem could have been avoided.

Among those policies, she said, were "prudent finance and living within your means, maxims easy to state but which require perseverance to apply."

The target of that message clearly was the Reagan administration.

As fellow conservatives, Thatcher and Reagan came to office determined to buck standard economic wisdom. Both aimed to promote growth by reducing taxes and limiting government regulation of the economy.

One of the principal differences between them, however, has always been Thatcher's belief that operating in the red was ultimately disastrous for economic health in spite of any short-term advantages.

Her refusal to countenance massive deficit spending, sometimes even at the cost of increasing taxes, brought her government to its nadir during the early 1980s, just as the deficit-financed United States was about to take off. At the same time, Reagan enjoyed an additional advantage in his ability to substantially cut social spending, a possibility that has always been out of bounds in welfare-proud Britain.

Critics of Thatcher's economic policies note that among the costs of her policies has been a drastic drop in Britain's manufacturing production level since 1979 and an unemployment rate that quickly grew to double digits.

The Thatcher government has received widespread voter credit for steadily reducing individual income tax rates from 83 percent for the highest brackets in 1979 to 60 percent. By contrast, in the seven years of the Reagan administration, individual income tax rates have gone from 70 percent to 38.5 percent in 1987 for the highest bracket.

But Thatcher's critics argue that the decreases have been political shams, since indirect taxes over the same period have increased, giving most Britons a higher overall tax burden than they had when she first took office.