Carter administration officials yesterday claimed that prompt diplomatic action by the United States, Britain and some Persian Gulf countries last weekend averted a dangerous Iraqi escalation of its war with Iran which could have spread hostilities to other countries.

Without providing any military details, those officials suggested that "ominous deployments" of Iraqi forces had indicated that Baghdad might have been planning to launch attacks from other countries on the three tiny Iranian islands in the vital Strait of Hormuz or on the nearby port city of Bandar Abbas.

There was no way to confirm this American version of last weekend's events with Iraqi sources.

Iraq, according to other officials, had moved troop-carrying helicopters into Oman, directly across the vital Persian Gulf waterway from the islands, and had dispersed numbers of its transport planes and attack jets to six countries throughout the region.

The concern here and in some other Gulf capitals, including Saudi Arabia, was that if Iraqi forces struck from different directions and other countries across the gulf, Iran might retaliate against oil installations in Saudi Arabia or other countries harboring the raiders, thus not only widening the war but also potentially imperiling western oil supplies and supply routes. t

The situation prompted lengthy meetings last weekend with the president and top administration officials. British Foreign Minister Lord Carrington, who was in Washington, reportedly canceled a planned visit to China because of the discussions here.

The Iraqi aircraft had been dispatched to Kuwait, North Yemen, Jordan, Saudi Arabia, Oman and the United Arab Emirates. Military officials, however, say that some of this movement was done before the major fighting began.

Officials say Oman and the UAE were the intended launching pads and that it was the movement of the helicopters and "other equipment," which must have stopped in other countries en route to Oman, that set off alarm bells here and in the gulf.

Military officials, while agreeing that President Carter and U.S. allies can take credit for damping down the war by pressing Oman and the United Arab Emirates to keep Iraq from using their countries as a staging base, stressed that the Iraqi planes were dispersed initially for defense reasons.

Either before the war started or in its early stages, one knowledgeable source recounted, Iraq asked Saudi Arabia, for example, to let its planes land there to escape any attempt by Iran to destroy them on the ground.

The Saudi government quickly agreed, the source said, and then had second thoughts as it saw the character of the Iran-Iraq air war change. Both sides, after first bombing and rocketing military targets, went after one another's oil facilities.

It was this bombing of oil targets, sources said, that made the Saudis nervous about letting Iraqi planes stay on their territory. The Saudis feared this would give Iran an excuse to bomb their oilfields.

Saudi fears were communicated to Baghdad and Washington, leading the Iraqis to withdraw their planes and the United States to send in four AWACS warning planes.

Government officials said Washington did not force the Saudis to require removal of the Iraqi planes as a condition for getting the AWACS planes. The two events were not linked in that way, they said, though presence of the Iraqi jets in Saudi Arabia while the AWACS planes were there could have looked as though the United States was siding with Iraq in the conflict.

Both U.S. and Saudi officials said yesterday that there are no Iraqi planes in Saudi Arabia now and that they would not be welcome in the foreseeable future as the Saudis try to keep out of the war.

Other military officials said, however, that the planes leaving Saudi Arabia appear to be going to other countries, and planes previously scattered to other Middle Eastern countries are still there.

The Iranian islands and port are several hundred miles from Iraq, and Soviet-built Iraqi planes could not reach them from home bases, which may also explain the dispersal to other countries.

Administration officials said yesterday that they believe the "more ominous" aspect of the Iraqi deployment is over, and expressed the view that the fighting won't spread.

The administration officials who provided information on the administration role in the dampening down of this situation could not be identified under rules of the briefing given reporters.