Iran's slide toward chaos and the crumbling of the shah's power are stirring deep concern in moderate and pro-Western Arab countries, which are apprehensive about the outcome but powerless to affect it.

Officially, the leaders of Egypt, Saudi Arabia and the Persian Gulf sheikdoms have been discreet, partly because they still hope the shah can salvage a measure of his rule and partly because of uncertainty over which way Iran would go if the shah fell.

For Egypt and Saudi Arabia, which have aligned themselves politically and militarily with the United States, the crisis in Iran also is seen as a test of U.S. determination and ability to help its friends.

Already uneasy about Soviet gains on the flanks of the Arab world in Ethopia, South Yemen andAfghanistan, the Arabs fear that pro-communist forces might capitalize on the turmoil in Iran to establish their influence there. Iran, which has a long border with the Soviet Union, would then cease to be the bulwark against Soviet political and military expansion in the Middle East that the shah sought to make it.

At a briefing for foreign correspondents last week, Egypt's acting foreign minister, Boutros Ghali, said Egypt hopes for a peaceful solution to the Iranian crisis. He said stability in Iran is vital to stability throughout the Middle East, and that Egypt is watching developments there closely. Observers here noted with some surprise that he did not specifically express support for the shah, who has been personally and politically close to President Anwar Sadat.

Political analysts here believe it is not a coincidence that Egypt has begun giving extensive publicity to allegations of corruption among government officials, or that Sadat has called on public officials to trade in their Mercedes for Bolkswagens. Charges of corruption and high living in the Iranian royal family and the government have been among the main grievances of the shah's opponents.

Nor did Egypt make any attempt to move against the magazine of the Moslem Brotherhood, an organization of Moslem extremists, when it expressed support for Iranian mullahs opposing the shah. Though nothing has been said officially, informed Egyptians concede that this would not be a propitious time to antagonize Egypt's devout Moslems, who have been asserting themselves socially and politically for the past two years.

The volatile mix of politics and religion also has figured in Saudi Arabia's relations with Pakistan which has borders with Iran and Afghanistan and suppliesd much of the labor force in the oil states on the Arab side of the Gulf.

Saudi Arabia has been making a show of support for Pakistan's ruler, Gen. Zia ul-Haq, who has embarked on a program of Islamic orthodoxy that includes revision of laws to conform to Islamic doctrines and imposition of requirements that government officials pary in their offices.

Collectively, Geypt, Sudi Arabia and Pakistan are avoiding any pretext for Moslem dissidents or religious extremists to attack the government, as they are doing in Iran.

Officials in the United Arab Emirates, the confederation of sheikdoms at the southern end of the Gulf, have watched the situation in Iran with a certain sense of irony. They say they remember well that when the Emirates became independent on withdrawal of the British only seven years ago, it was Iran -- self-proclaimed defender of regional stability -- that warned of turmoil and upheaval on the Arab said of the Gulf.

Iran even seized two Gulf islands claimed by the Emirates in a shwo of military power and its role as policeman of the Gulf. The same military power enabled the shah to intervene on the side of thesultan of Oman in the struggle against leftist rebels in Oman's Dhofar Province.

That Iranian role as regional superpower has evaporated almost overnight, and it is not yet clear what force will replace it, if any.

Saudi Arabia, Kuwait and the Emirates have moved to consolidate their won close ties and, according to reports from the region, are especially eager to smooth over any trouble in the Arabian Peninsula that might lead to unrest. Politically, these countries are in a completely different situation from Iran and much less vulnerable to internal unrest. But they lack the military capability to defend themselves, or their oil fields, if trouble should break out. The Saudis reportedly banned any newspaper reports about the trouble in the Iranian oil fields for several weeks to avoid calling attention to their own weaknesses.

A Saudi newspaper this week noted reports that insinuate that the Iranian situation would have adverse effects on the Arab states of the Gulf. This, it said, is a "false assumption," because the situation in Iran is "purely internal" and thus irrelevant to Iran's Arab neighbors. The cause of the Iranian strife may be irrelevent, but officials of the Arab governments do not feel that way about the potential effects.