In the greater scheme of international banking, $5.8 million is a trifling sum. But last week, when Romania fell $5.8 million into arrears in its debt to the U.S. government's Commodity Credit Corp., it was enough to set senior U.S. policymakers in Washington and bankers in New York to speculating about the soundness of the whole international financial system.

After a Thursday ultimatum by the State Department to pay up, the debt finally was brought current Friday, the Romanian Embassy announced here yesterday. The State Department said it had "no doubt that the payment has been made."

When sovereign governments cannot pay debts, bankers and government officials get nervous. And the next few months are likely to be an unusually nervous period.

"Right now my advice is to hold our breaths and hope that the house of cards comes down slowly rather than all at once," said one pessimist in the Reagan administration last week.

Not all bankers or officials share the view that Romania and Poland are the first in a chain of falling economic dominos. But there is agreement that high interest rates, expensive oil and a world recession that has dampened demand for raw materials on which many countries depend for export earnings are pushing many nations to the financial wall.

In the borrower's market of the 1970s, governments abroad were encouraged by relatively low interest rates and soaring inflation rates to go deeply into debt. And international banks, inundated by the deposits of Middle East oil countries, rushed to lend the funds.

Now, say bankers who follow the foreign debt situation closely, many countries are caught in a major adjustment in the world economy. New borrowing is needed to finance trade deficits brought on by the recession.

But international bankers suddenly have turned wary about making new loans. At the same time, high interest rates are forcing government borrowers to divert more of their trade surpluses to servicing debts rather than building up economies.

As in any period of economic hard times, the weakest and most overextended are the first casualties. But when countries rather than companies are the bankrupts, politics inevitably becomes a complicating factor.

Poland's martial law regime is nearly bankrupt and has little hope of catching up soon on the interest, let alone principal, owed to western banks and governments. But in its case any financial aid package depends on progress toward lifting martial law.

Even though its accounts are now current with the U.S. government, Romania is far behind in payments to private creditors, and is negotiating with them over a "limited rescheduling" of at least $1 billion of outstanding loans.

During the week of Feb. 15, a 12-bank steering committee headed by the Bank of America met with Costa Rican officials in San Jose to discuss ways of rescheduling loans outstanding from syndicates made up of some 150 banks.

Costa Rica reportedly is in arrears by $100 million on loans from private creditors, and could fall behind by $250 million by the end of the year if a financial package is not worked out.

The Costa Rican central bank has also delayed paying interest on a $50 million bond due on Dec. 11.

In 1981, Pakistan, Zaire, Liberia, Uganda, Senegal, Togo, Madagascar, Central African Republic and Poland made arrangements for payment delays with the International Monetary Fund or with the foreign governments that had loaned them money.

In the next few months, bankers say, new countries such as Ivory Coast and Yugoslavia could encounter difficulties servicing their debts. And some express concern about the financial stability of two more Soviet bloc countries, Czechoslovakia and East Germany.

The hard currency debt of Soviet bloc countries and their trade banks is now at least $65 billion, of which about $18 billion is in short-term western commercial bank loans of up to one year, mainly for financing routine trade in commodities.

Before the trouble with Poland and Romania, western creditors assumed the Soviet Union would cover the debts of its allies in an emergency and that centrally planned communist governments were especially well equipped to keep tight control of their finances. Neither assumption has proved accurate in Poland and Romania.

In a recent analysis of the East European debt situation, Wharton Econometric Forecasting Associates said a western declaration of default against Poland could set off a credit squeeze in the rest of the Soviet bloc in which the West would be "threatened with the prospect of writing off an additional $38 billion" (in addition to $22 billion written off in Poland).

Many experienced bankers say that the banks, the international financial system and the countries that now seem troubled have a good chance of weathering the difficulties.

One recent bank analysis of Brazil, Turkey and Sri Lanka concluded that all three could solve their financial problems, although the adjustments would involve painful decisions such as giving up ambitious projects, raising food prices and shifting industry from consumer goods production to production for export.

International financial analysts note that just six countries--Mexico, Brazil, Argentina, Chile, Colombia and Peru--account for half of the commercial bank lending to developing countries, and all of these countries are rich in resources, minerals, food and in Mexico's case oil.

Nevertheless, concern over the impact of the debt problem on U.S. banks has been voiced by Federal Reserve Board member Henry C. Wallich, in an address in London Feb. 9.

Wallich called for banks to be more "rigorous" in writing off bad debts even at the risk of taking some losses, and said "rescheduled loans weaken a bank in many respects."