The Reagan administration has rolled the dice in the Caribbean. By laying American presite on the line there, Secretary of State Alexander Haig has risked a humiliating setback. But a happy outcome -- an outcome that will work to this country's advantage locally, and in dealings with the allies and the Soviet Union -- is suggested by many signs, including Leonid Brezhnev's speech to the 26th Party Congress in Moscow.

Immediately at stake is the shaky right-center junta that now rules El Salvador. It is a weak coalition of elements in the army with elements of the Christian Democratic Party. It faces opposition from right-wing extremists, many of them now living in Florida. It is also under fire from a radical guerrilla movement, Marxist at the core, that has received military support from Castro's Cuba via the left-wing Sandinista government fo Nicaragua.

The United States has come down on the side of the junta, and against the guerrillas and their arms suppliers. The American position was declared abroad in diplomatic conversations with the major countries of Latin America and Western Europe. If the junta now collapsed, the United States would cut a ridiculous figure all over the world.

But El Salvador is a mini-state in the back yard of the United States. If this country cannot sustain the junta by a limited application of muscle, then it should quit the Great Power business. Moreover, there is good reason to believe that American influence can be used to broaden the base of the junta.

Both the Catholic Church in this country, whose missionaries have been killed by right-wingers in El Salvador, and the American labor movement, which has had its representatives rubbed out, are pressing for a liberalization of the regime. It is notable in that respect that Haig has chosen as the new ambassador to El Salvador Deane Hinton -- one of the most intelligent, broad-gauged officials in the Foreign Service.

A favorable outcome in El Salvador will pay immediate dividends throughout the neighborhood. The left-wing regimes of the area have been put on notice that the United States will not stand for any more subversive hanky-panky. Already there are signs that the lesson has been absorbed in Nicaragua and in Costa Rica. Venezula has also taken its distance from the rebels of El Salvador, and Mexico is being nudged in the same direction. Fidel Castro thus face the prospect of isolation.

The European allies have been brought into the picture by briefings from an American mission under Ambassador Lawrence Eagleburger. In the next few days, Haig will be pouring out the story further in direct conversations with visiting French and British officials.

Wariness characterized the initial response of the allies. President Valery Giscard d'Estaing gave Jim Hoagland of this newspaper an interview that emphasized France's ambition to play a mediating role between the United States and Russia. Chancellor Helmut Schmidt criticized the Reagan economic program in a way that left West Germany an excuse for not blindly following American foreign policy.

But if American power proves itself in the Caribbean, the European allies will stand up and salute. This country will then be in much stronger position to elicit support for joint policies in the Middle East and with respect to the Russians.

The Soviet Union, of course, is the principal policy target. The Russians have complained noisily about "American imperialism" and its dential of "liberation movements" in the "third World." But Brezhnev's speech at the Party Congress yesterday showed that Soviet toughness in the Caribbean stopped with rhetoric. By calling for renegotiation of the arms control agreement and further contact with the United States at all levels, Brezhnev pulled the rug out from under the Cubans. Having stood by its guns in the Caribbean, the United States now seems to be in good position to make some gains everywhere.

That happy prospect, however, should not obscure some secondary causes fro concern. Congress -- particularly its right-wing elements -- shows no comprehension of what has been happening. By refusing to approve Haig's major appointments, the Senate has forced him to operate with a skeleton staff of inexperienced and unknown associates who have not been confirmed in office.

The White House has participated in that political appeasement of the Republican know-nothings. In the same spirit, the president has twice asserted that the Soviet Union, by its very nature, is bent on achieving "world domination." One wonders whether the president, who finds the Russians constitutionally unable to accommodate, has met the secretary of state, who seeks from them a "code of conduct."

For the time being, to be sure, these problems are secondary. But unless mastered now, they will reemerge in sharper form as the United States settles to the difficult business of working with its allies and living with its foes.