The United States and the Soviet Union are the two greatest military and economic powers in the world. They are the only truly global powers. They are superpowers. Yet today's world is so complex and smaller countries have such resources of their own that it is possible for the two smaller countries here involved to defy the giants of the world.

The methods of defiance used by Iran and the Afghans differ. The Afghans are just people possessing primitive weapons and a stubborn reluctance to submit to any form of foreign rule. They keep shooting at Soviet troops -- more by night than by day. They have so far been able to prevent consolidation of Soviet control and withdrawal of Soviet troops. One effect is to embarrass Moscow in the outside world. Another is to tie down some 100,000 Soviet troops in and around Afghanistan.

The US effort to coerce Iran has been even less succesful. The measures Washington has applied have tended to increase anti-Americanism in Iran without doing more damage to Iran's economy than the Iranians themselves had already done. The Soviets and their Eastern European partners have been quick to supply goods that have been withheald by the US and its allies. Some Western allies have benefited. Japanese exports to Iran and imports from Iran both increased during the first months of this year. British and West German exports also have been reported to be increasing.

Washington's friends and allies have been ready and willing to deplore the holding of hostages, and action against all international law. But only the United States itself seems to believe that economic sanctions might secure release of the hostages. The others have gone along with the sanctions campaign only reluctantly and halfheartedly, if at all. They argue that the attempt to coerce merely worsens the rift between Iran and the West, makes the Iranians cling all the more stubbornly to the hostages, and benefits Moscow. It pushed Iran toward Moscow now and could, in an emergency, give Moscow an excuse to move its troops into Iran.

Meanwhile it distracts world attention from Moscow's use of armed force against Afghanistan.

Another effect of the US policy of attempted coercion of Iran is to underline once again the fact that the NATO alliance only operates willingly and effectively where it is designed to operate -- in the North Atlantic area.

The North Atlantic treaty binds its members to come to each other's aid in the event of an attack on anyone in the European area. There is nothing in the treaty that binds its member to take action when the interests of a member are damaged outside the NATO area.Iran and Afghanistan are well outside the NATO area. There is nothing in NATO that applies in these cases any more than there was when the British invaded Egypt (1956) and when the French tried to recapture their lost colonies in Indochina (1946-1954).

Iran has substantial assets in its resistance to attempted US coercion. It has oil to sell. (Afghanistan has virtually nothing to sell.) Iran is located strategically between East and West communities. It can play one off against the other as it has played off its neighbors for some 3,000 years. And in these times world opinion tends to look with disapproval on any effort by a great power to push around a small one -- even when the small one has transgressed the laws of nations (in this case by holding hostages).

The US would have been more successful in mobilizing world opinion against Moscow over Afghanistan had the US itself not already been engaged in a campaign of coercion against Iran. That campaign (against Iran) has embarrassed even the staunchest friends and allies whose profound regret is that Washington continued to be solicitous of the dethroned Shah long after they had done their best to cultivate the incoming Ayatollah Khomeini.

In retrospect, letting the Shah come to New York City for medical treatment was a disastrous mistake. He had already been refused permission to go to London for such treatment, or for any other purpose.

The above makes it all the more remarkable that the threadbare Afghans have managed to keep up their guerilla resistance to Soviet occupation. How much longer it can go on is a question. Certainly the best thing that could happen to them would be for the US to extricate itself from its present bad relations with Iran and be able to devote more attention to the campaign to help the Afghans.

Until Washington can shed the odium in world eyes of being the "big guy" trying to push around the "little guy," Iran, it will have hard going in the anti-Soviets-in-Afghanistan game.

But for President Carter in the White House the task of swinging the US around from a policy of attempted coercion of Iran to the alternate policy of attempted reconciliation would seem to be insurmountable.Edmund Muskie, his new secretary of state, tried to give him a lead this past week by taking up a benign and tolerant attitude toward the wayward Ramsey Clark. But Mr. Carter felt it necessary to threaten the same Mr. Clark with possible federal prosecution for having gone to Iran in defiance of Mr. Carter.

The result seems to be that the Afghan tribesmen will continue to have to fight their battles almost without effective outside help. Mr. Carter is able to deliver a mild punishment to Moscow by keeping some athletes away from the summer Olympics. But this is hardly much comfort to the single Afghan tribesman huddled in his cave trying to keep out of sight from the Soviet helicopter hovering overhead and ready to unload bombs, rockets, or napalm on him.

If Mr. Carter really wanted to help that Afghan tribesman, Mr. Carter would swallow his American pride and tell the Ayatollah that the US has made a lot of mistakes in its behavior toward Iran over a long stretch of time.

But what President could do such a thing from the White House during a presidential election year?