President Reagan said last night that the possibility that Mexico might fail to pay the interest it owes on $98 billion in foreign debt prompted the United States to help the debtor nation in negotiations with international lenders.

In a news conference, Reagan said that Mexico and the United States "are linked on many fronts, so we want to be of as much help as we can."

Reagan said that Federal Reserve Board Chairman Paul A. Volcker took a secret trip to Mexico City on Monday in an attempt to break an impasse between the debtor nation and the International Monetary Fund, the multinational financial rescue agency.

Before Volcker's trip, Mexico and the IMF had been negotiating unsuccessfully for nine months on a new economic program that would lay the groundwork for Mexico to borrow billions of dollars it needs to replace some of the income it has lost because of the severe plunge in oil prices this year. Sources said they hope to devise a plan within a few weeks that the IMF would approve.

Volcker's visit appears to have revived stalled negotiations between the IMF and Mexico.

Reagan said he fears that "a number of other countries that are having these debt problems" might run out of cash. "And, obviously, we'd like to be of help to them."

Volcker testified before a House Government Operations subcommittee yesterday that it is incumbent on the international financial system to properly handle the new, oil-induced financial crisis in Mexico.

Because the economic problems of many major debtor nations are interrelated, what happens to Mexico will influence a large number of other debtor nations such as Argentina, Venezuela and Nigeria, he said.

If Mexico cannot come to terms with the IMF and its commercial bank lenders soon, it will run out of the dollars it needs to pay the interest on its $98 billion foreign debt. If Mexico were to suspend interest payments, private commercial banks might be forced to take severe write-offs on some or all of its Mexican debt. The long-festering debt crisis could erupt again into a panic, as it did in 1982.

As they did in 1982 -- when Mexico announced it had temporarily run out of the money it needed to pay its foreign bills -- U.S. officials have taken a major role in trying to devise an economic program acceptable to Mexico and the IMF.

U.S. Treasury Secretary James A. Baker III said in a speech yesterday that "we are actively working on this issue and are confident that Mexico can stabilize its situation."

In the main, Mexico will have to press its population harder to produce the foreign exchange it needs to pay its bills -- cutting imports, increasing exports and reducing the government's borrowing needs by slashing spending. The country, which had severe recessions in 1982 and 1983, is facing another sharp decline in production and employment this year because of the loss of income triggered by the fall in oil prices.

Mexico and IMF officials have deadlocked on how much Mexico should cut government spending. The IMF wants a small budget deficit, despite the loss of oil revenue, while Mexico has argued it cannot cut spending as much as the international agency wants.

International bankers said yesterday that they still have not had formal negotiating sessions with Mexico, even though private banks are expected to provide a sizable chunk of the $5 billion to $7 billion in additional funds Mexico will have to borrow this year.

William R. Rhodes, the Citibank executive who heads the bank committee that negotiates with Mexico, said in a New York speech yesterday that he hopes the IMF and Mexico can work out an agreement "in the next few weeks."

Meanwhile, the Mexican peso, which had fallen to 730 to the dollar on Monday, rebounded to about 640 to the dollar on Tuesday and stayed in that range yesterday