THE INVASIONS OF Iraq by Iran and of Lebanon by

Israel in the space of a few weeks have brought the Arab world to the brink of shattering historical change. The invasions not only threaten individual Arab regimes and the Palestinian guerrillas, but also the survival of modern Arab nationalism as fashioned three decades ago by Egypt's Gamal Abdel Nasser.

That result is still far from certain. Iraqi troops and civilians fighting on their own territory could repel the Persian invaders and rescue the Arab nationalist regime of Saddam Hussein in Baghdad. The Palestinian guerrillas trapped in Beirut could still emerge alive to reclaim the role granted them as the human weather vane of Arab nationalism.

But the twin challenges of Islamic and Jewish fundamentalism unleashed by Iran's Ayatollah Ruhollah Khomeini and Israel's Menachem Begin have confronted the Sunni-dominated, Western-oriented political establishments of the Arab world with a potential disaster that the United States appears to be powerless to help them escape.

Iran's continuing victories against the collapsing Iraqi army have consolidated Khomeini's once-shaky religious regime and established what one European diplomat now calls "the first true revolution in Islam. Through this war, Iran is becoming to Moslems what the Russians became to communists through their revolution and victories over the White Army after 1917."

If Khomeini succeeds in his vow to topple Saddam Hussein and establish a government in Baghdad sympathetic to his Islamic revolution, the border between the Arab world and the Islamic but non-Arab East would effectively disappear. The revolutionary impulses of the Shia branch of Islam would sweep again down the western shore of the Persian Gulf and into the Levant.

Even before the Iranian thrust across the Shatt al Arab estuary, Israel's bold chase of the Palestine Liberation Organization's guerrillas all the way into Beirut had broken the political clock of the Middle East as it had been thought to be ticking since the 1973 Arab-Israeli war and the beginning of the energy crisis. Suddenly the Arabs were yanked back at least a decade, seemingly mired again in the hopelessness and humiliation that Anwar Sadat and Saudi Arabia's King Faisal sought to erase with the October war against Israel and the use of oil as a weapon against the West.

The Camp David accords and the oil glut kept Egypt's military force and the Saudis' petroleum sword sheathed during this crisis. The conservative and moderate regimes friendly to Washington were reduced once again to warning of the threats that terrorism from embittered and radicalized Palestinians would pose to their survival and to American interests in the region.

For Begin, the elimination of the PLO would bring him closer to a central goal of the militant strain of Zionism he has always championed -- a Jewish state occupying all of mandated Palestine, including the territory known to the Arabs as the West Bank of Jordan and to Begin as Judea and Samaria. The invasion has turned Camp David into little more than a hindrance for Begin and his followers who want to annex the territory, a hindrance that they will probably find a way to dispose of in the near future.

The replacement of the secular Baathist regime in Baghdad by an Islamic revolutionary group beholden to Khomeini would also be enormously unsettling for the rulers of Saudi Arabia, Kuwait, Jordan, the United Arab Emirates and Egypt, all of whom are Sunni Moslems and whose survival the United States has repeatedly suggested is important to American interests.

At the same moment in history, the Sunni Moslems who head the PLO and who define its nationalist aims face extinction by the Israeli army.

Complex historical, cultural and doctrinal differences separate the Sunni -- the followers of the "Sunna" or "beaten path" of orthodox Islam -- and the Shiite. These differences go back to the 7th century and the struggles that erupted after the Islamic prophet Mohammed's death, and they are often simplified as centering on the Shiites' belief that the leadership of their society passes through a line of succession of Imams that started with Mohammed's grandson Ali, and not through the historic caliphs who won the power struggle in Mecca and set out their interpretations of the prophet's teachings.

This has produced a profound difference today: In most Sunni-ruled countries, religious activities are regulated by the state and often treated as an appendage of the bureacracy or political system. In Shia-ruled Iran, the Imam Khomeini's authority is supreme, and the state exists to serve Islam.

"Sunni Islam is the doctrine of power and achievement. Shia Islam is the doctrine of opposition," British writer Edward Mortimer records in his forthcoming book, "Faith and Power: The Politics of Islam." "The starting point of Shi'ism is defeat: the defeat of Ali and his house by the Omayyads (the original governors of Mecca) . . . Central to Shi'ism's appeal, especially for the poor and dispossessed, is the theme of suffering and martyrdom -- a theme reminiscent at times of Christianity."

"Khomeini has shown that the Shiite religious movement is the only successful mobilizer of masses in the region today," says a Sunni Arab politician. "The theme of justice for the oppressed, for the poor, is a powerful one for those who have been left out as the Arab elites manipulated the West for their gain by emphasizing abroad how secular their political parties were and how modern their states were, while behaving at home as if they were totally committed to Islam.

"Iran as a nationalist state under the shah was much easier for the Arabs to deal with even though it was stronger militarily then," he continued. "The shah (Mohammad Reza Pahlavi) fought with (Iraq's) Saddam for a while (in 1974) and then he made a deal to stop fighting. That dispute was over something tangible, and could be settled on national grounds. Khomeini is challenging everyone on religious grounds, and there can be no compromise."

The Sunni elites interested in power and modernization have been the natural interlocutors for the West and the avenues for Western intrusion into the region. Much of the dichotomy -- schizophrenia to critics -- that has made these elites vulnerable to Islamic challenge results from that interaction with the West, and particularly with an America that sought over the past decade to build up two non-Arab states, Israel and the shah's Iran, into the region's superpowers.

Occupied for centuries by the Ottomans and for much shorter periods by European colonialists, the Arabs of Egypt and the Levant began to reassert their common culture, language and heritage in terms of nationalism toward the end of the 19th century.

After World War I, a deep sense of nationalist injury sprang up among the Arabs. They believed that Britain had promised that Palestine and much of Lebanon would be part of the new independent Arab nation as a reward for their help against the Germans in the war. Instead, they saw Britain take over Palestine and promise Jewish emigrants from Europe a "homeland" there, and then they saw France took over Lebanon.

The defeat of the Arab armies in 1948 by Israel triggered the rise of Nasser and the Free Officer movement in Egypt and the subsequent efforts to found a new, stronger and ideologically motivated Arab nation. With hesitation and continuing uncertainty, American Middle East policymakers came to support Arab nationalism and the concept of strong Arab state structures as useful tools in combatting communist influence in the region. Nasser and the officers and coup-makers that came to power elsewhere in region did move quickly to crush local communist parties.

The United States was also strongly supporting the shah's efforts to secularize and modernize Iran, whose population of 36 million is largely Shiite. Displaying a penchant for martyrdom that staggered the shah's Western supporters and broke the monarch's will, the Shia mullahs led the street demonstrations that drove the shah into exile in January 1979, and brought Khomeini to power the following month.

Large Shiite populations also live in Iraq, where they make up about 55 percent of the 13 million population, and in Lebanon, where they are perhaps one-third of the 3 million inhabitants. For different reasons, the Shiites in Iraq and in Lebanon may hold the key to the shape of Arab nationalism in their countries now.

In Iraq, the ruthless Baath nationalists who seized power in 1968 were able to push secularization of the state and party beyond Nasser's most ambitious dream for Egypt. But despite major economic advances for the population as a whole, political, military and economic power remained largely in the hands of the Sunni Arab minority. Saddam Hussein's periodic crackdowns on Shiite demonstrators and clergy, and especially the torture and execution in April 1980 of Sayed Baqir Sadr, a Shiite ayatollah who supported the ideas of Khomeini on Islamic government, have made the Shiite majority fertile ground for the Iranian message of religious revolt.

"Khomeini will not install a government in Iraq if he wins," predicts an Arab politician in touch with the Iranian government. "That is not his style. He will be the religious guide, not a ruler."

But Sayed Baqir Mohsein al Hakim, an Iraqi Shiite religious leader who escaped to Tehran two years ago, undoubtedly would have great influence in a Khomeini- backed government. The underground Islamic Daawa (The Call to Islam) Party that has practiced sabotage inside Iraq and kept its leadership secret is another pole of Shiite opposition to Saddam Hussein.

The increasingly strong Iranian showing against the invasion that Iraq launched in September 1980 has driven the once radical Baathists together with conservative Sunni leaders such as King Hussein of Jordan, King Fahd of Saudi Arabia and the Kuwaiti ruling family, all of whom were only recently high on the Baathist's revolutionary hit list.

Despite urgent appeals by these leaders to Washington, the Reagan administration last week reaffirmed its neutrality in the war as Iranian troops crossed into Iraqi territory. This appears to have fanned new suspicion among Sunni leaders that the United States is keeping its options open to switch to a more friendly post-Khomeini Iran as a bulwark against Soviet expansionism if conditions change.

In Beirut Sunni leaders who made their own deal with the Maronite Christians who effectively excluded Lebanon's Shiites from real power for four decades are now very visibly bargaining with U. S. mediator Philip C. Habib in an effort to save West Beirut and Yasser Arafat's Fatah guerrilla organization from total destruction at the hands of the Israelis. Fatah, which has come close to saying it will agree to accept a West Bank-Gaza state and make peace with a pre-1967 Israel in return, is seen by most Arab regimes as a pragmatic Sunni center for the PLO.

The Maronite Christian militia that the Israelis evidently hope to install as the dominant political power in Lebanon after they withdraw will need the help of the increasingly strong Shiite militia to keep the lid on. Khomeini's strong ties to the Lebanese Shiites could be the decisive factor when the Shiites decide how to play their cards.

The enormous dangers the Arab governing elites suddenly face have provided a reminder, if one were needed, of the cyclical nature of Arab politics. Riding high after the 1973 war and the explosion in petroleum revenues, few Arabs could imagine that their nations would ever again taste the kind of bitterne and defeat they had known in the 1960s. Today, it is easy to conclude that apocalypse is at the doorstep.

But beyond the momentary ascendance of the Shiite movement and the dilemma the Arabs now confront is almost certainly the beginning of a new cycle, with a new group of nationalists -- perhaps Sunni, perhaps Shiite, perhaps both -- already gathering in an army barracks or a political club to begin the long and difficult process of redefining and inspiring again the force of Arab nationalism that will rise to haunt the political heirs of Begin and Khomeini.