President Reagan is about to receive a warning from his closest ally in Europe: Don't listen to demands generated by the presidential election campaign to protect key segments of United States industry from foreign competition.
Such protection could choke world trade, slow world economic recovery, and upset allies.
The warning will come from from British Prime Minister Margaret Thatcher, now the longest-serving leader in the Western world, and her trade and industry minister, tall and urbane Cecil Parkinson.
Both are about to visit the US - Mrs. Thatcher tomorrow after a brief visit to Canada, and Mr. Parkinson Oct. 16.
Each will also carry a request, this time to US businessmen: Please invest more dollars in stable Britain, now free from left-wing rule for another five years following Mrs. Thatcher's reelection June 9.
British concern springs from Mr. Reagan's recent decision to impose quotas and tariffs on European ''specialty steels'' - alloys usually made with rare metals - to protect US steelmakers. Mr. Parkinson will tell US officials they are wrong to think that the (STR)10 million ($15 million) worth of specialty steel exported to the US annually is government-subsidized. Most of it is not, he says.
His concern, and the prime minister's, is that the election campaign might now encourage the US to drift away from the declaration against protectionism made at this year's seven-nation economic summit in Williamsburg, Va.
The warning comes against a background of generally warm relations between the conservative Reagan and Thatcher governments.
But it does highlight the fact that Britain needs free world trade much more than the US does. About one-third of everything Britain produces is exported; only about 10 percent of American output is sent abroad.
Prime Minister Thatcher is also concerned about two other developments in the US.
* One is pending legislation that would give the administration the right to order European companies with ties to US firms not to export to the Soviet bloc. Britain and other European countries insist that Washington cannot issue such orders to European companies.
Late last year the US began backing down from a nearly two-year effort to ban exports of materials and equipment for the natural gas pipeline from Siberia to Europe.
* The other issue is so-called ''unitary taxation,'' by which individual states claim the right to tax corporations located within their borders on income worldwide.
She will tell Mr. Reagan that the move could backfire on the US, which has more multinational corporations than any other country.
''If the decision on unitary taxes goes through unchanged,'' Mrs. Thatcher told US correspondents on the eve of her trip, ''the idea could spread to other countries, and could undermine investment generally. Britain needs such investment. So does the US.''
As the prime minister talks to US businessmen and the Senate Foreign Relations Committee, as well as to the President and Cabinet members, she will reflect a general European disquiet at the size of the US budget deficit and the prospect that it will continue to grow for structural reasons, keeping interest rates higher than they might otherwise be.
Europeans look to a prolonged US economic recovery to help pull their own countries out of a recession which has put 34 million people out of work in the major industrial nations of the Organization for Economic Cooperation and Development in Paris.