MOZAMBIQUE occupies a distant corner of Africa, and a distant corner of American foreign policy. Even in respect to southern Africa, the American interest there is a sideshow. It is, however, an intriguing one. Mozambique is the one place in the world where the conservative, anticommunist Reagan administration is attempting to wean an avowedly Marxist, Soviet-supported state out of "the other camp," as the president put it the other day. Everywhere else in its dealings with Marxist states -- Nicaragua is only the most conspicuous case these days -- the administration is more or less bearing down.

Why the special treatment? It struck American policy planners, focusing first on South Africa, that the inability of Mozambique's Soviet patrons to protect it from massive South African intervention and subversion gave Washington an opening to play the protector. This it attempted last year by brokering the Nkomati nonaggression pact between Mozambique and South Africa. The Soviets' inability to provide Mozambique, economically a basket case, with much more than bad advice gave the United States a parallel opening to promote free enterprise and Western economic ties.

The new American policy is still to produce results. Just the other day Pretoria admitted to keeping up aid to the Mozambican resistance, aid it had pledged at Nkomati to cut off. The Reagan administration, its policy of constructive engagement in southern Africa otherwise in shambles, welcomed President Samora Machel this week and sought to assure him the pact can be patched together again.

Mozambique, which applied for membership in the Soviet economic bloc only a few years ago, is now joining the West's financial institutions. But it has yet to reap anywhere near the massive economic benefits it needs. President Machel has a long memory of Western abuse, and a continuing fascination with Marxism at least as an "instrument of analysis."

For his experiment in dangling carrots before Marxists, President Reagan finds himself under passionate attack from the domestic right. It sees him undertaking foolishly to bail out a brutal Marxist dictatorship. Legislators on the right have sought to ship arms to the South African-aided Mozambican opposition even as the administration was pressing for (nonlethal) military aid to the Soviet- armed regime. It may have been the first time Congress was ever asked to arm both sides in a civil war. It turned down both requests, but is giving substantial food assistance and some economic aid.

The administration is taking a flier in Mozambique. It's risky, but it's worth it.