The Arab world is watching warily as the United States hardens its sanctions against Iran and speaks more openly of using force in the Persian Gulf.

More important than hard-line declarations of Arab nationalists is the growing concern of Arab oil-producing governments sharing the Persian Gulf, who have the most to lose in a U.S.-Iran conflict.

According to Arab sources, those countries would be hard pressed to avoid coming to Iran's assistance against an American blockade to prevent Iranian oil from leaving the gulf or manufactured goods from entering.

A main topic of next month's scheduled meeting of Islamic foreign ministers will be what to do if a blockade is imposed on Iran, which is Islamic but not Arab, the Arab sources said. And appeal for Islamic solidarity against the West would be hard to resist. The gulf countries have made opposition to foreign intervention a major principle.

Arab attitudes, particularly those of the oil exporters, are a major consideration as European nations and Japan weigh their own petroleum needs against a call by President Carter to join in breaking relations with Iran and cutting exports.

The power of Islam to rally public opinion against the United States was dramatically illustrated last fall, when mobs attacked U.S. embassies in Pakistan and Libya. Similarly, the importance that gulf Arabs attach to keeping out Western powers has been underlined by reluctance to cooperate openly with the United States in strategic responses to the Soviet intrevention in Afghanistan.

In addition, the gulf's two major Arab powers, Saudi Arabia and Iraq, have particular reasons to resist any American military action.

Saude Arabia, shaken by the Great Mosque takeover at Mecca last November, is eager to burnish its image as a stronghold of Islam to refute the Mecca rebels' contention that the royal family was forsaking Moslem traditions for swift Westernization.

Iraq, rich and powerful under ambitious President Saddam Hussein, has for months been seeking ways to assume a bigger gulf role in accordance with Hussien's designs on nonalignment leadership.

For the moment, however, Iraq's increasingly hostile confrontation with Iran has overshadowed the hosage drama, and even the possibility of U.S. military intervention, in most of the Arab world. Here in Beirut, which still mirrors the Middle East despite its own troubles, first the Iraqi and then the Iranian airlines offices were damaged this week. No one thought to attack such venerable Amercan targets as the U.S. Embassy's John F. Kennedy Library.

The Iraqi-Iranian conflict so far has been limited to a war of words, punctuated by border exchanges and Iraq's expulsion of Shiiite Moslems suspected of sympathy for Iran's revolution.

The dispute could prove advantageous to the United States. From Yasser Arafat's Palestine Liberation Organization to the conservative gulf kingdoms, Arabs have declared publicly or privately that they will back Iraq whatever happens. This show of Arab solidarity already has muted support that Iran could otherwise have expected to enjoy among its Moslem gulf neighbors and nationalist Arab states that feel kinship with the Iranian revolution. In the event of broader hostilities, it could rob Iran of nearly all Arab support.

"There is one posibility that could lead the gulf Arab countries to abstain from supporting Iran in its escalating confrontation" with the United States, wrote Lebanese analyst Marwan Iskander in the independent Beirut newspaper An Nahr. "That is the possibility of a shift in the propaganda war between Iran and Iraq toward a genuine war between the two countries."

Short of that, however, sources here predict that gulf Arabs would come to Iran's aid against a U.S. blockade, facilitating overland transit and extending credits to make up for blocked oil shipments.

Stronger reaction, including reduction or cutoff of Arab oil shipments, would be unlikely, they say, except in response to a direct military attack against Iran. However, the presence of U.S. warships enforcing a blockade could set off a wave of outrage in the Arab world and force the gulf oil countries into measures they would rather avoid.

This is particularly true, Arab analysts say, because of what they allege is a widespread impression among U.S. allies in the Arab nations, as well as its foes, that the Carter administration does not have a firm idea of where it is heading.

This impression, which is reported to be shared from the gulf royalty across the region to the Palestinian leadership in Beirut, has been reinforced over the last year by Washington's conduct of the Camp David autonomy negotiations, Arab sources say, and now is being reinforece by the Iran crisis.

Reflecting this assessment one of the Middle East's most prominent journalists, Michcael Abu Jawdeh, wrote this week:

"Ammerica went off on its own with the Camp David policies and brought the Middle East crisis to a dead end because the leadership of the United States was not the genuine leadership imagined by those closest to it, namely the Egyptian president. Then America acted in Iran . . . in protecting the hostages, and now with its allies in Europe and Japan as if it does not know what it wants. Yet it wants all its allies, all the countries of the world and the United Nations to participate with it in this operation of ignorance."

Outside the gulf area, Arafat has warned that his guerrillas would fight on the side of Iran against an American attack. His closest supporters in the Steadfastness and Confrontation Front -- Syria. Libya, South Yemen and Algeria -- declared yesterday that they also would back Iran in a showdown with Washington.

The strong words of these hard-line Arab leaders, however, are expected to remain nothing more than that. Iran's strident Third World opposition to American influence in the Middle East and its Islamic revolutionary underpinnings make Tehran a natural ally for the Arab nationalists. But their main concern remains the struggle against Israel and they are thought unlikely to deviate energy from that cause to back Iran beyond declarations of support.