The United States and four Western allies warned yesterday that they may provide arms to Somalia if the expanding Ethiopian offensive in the Ogaden region spills across the Somali border.

Secretary of State Cyrus R. Vance said at a press conference in Washington that the Soviet Union, which is backing Ethiopia, has given assurances that Somalia would not be invaded. "I hope and expect that [the assurance] would be carried out," he added.

Vance said the United States is sticking to its hands-off policy of refusing to supply arms to either side. But he added: "If a crossing of borders occurred, that would present a new and different situation and we'd have to consider it at that time."

Diplomat sources in London said the United States, Britain, France, West Germany and Italy had told the Soviet Union and Ethiopia that extending the war into Somalia would create an entirely new situation, and cause reconsideration of the western nations' refusal to arm the Somalis.

Ethiopia launched a counter-offensive last week to regain the Ogaden area and it was reported that its forces are driving toward the border.

Vance yesterday repeated estimates that about 1,000 Soviet and 3,000 Cuban troops are in Ethiopia. He added that about 2,000 of the Cubans are involved in air and ground combat roles. It is understood that the Cuban ground forces are mainly being used to provide tank and artillery support.

The presence of foreign forces, Vance said, "obviously can't help but affect our relations with Cuba and the Soviet Union."

He also indicated that the United States is showing down negotiations currently being held with the Russians on demilitarizing the Indian Ocean as a protest over their activities in the Horn of Africa.

"What seems to be happening there is inconsistent with a limitation of forces in the area," he said adding that it is "a matter we obviously will keep in mind as we proceed with these talks."

Cuba's involvement, Vance knowledge, had become a major complication in the move toward normal U.S. Cuban relations. But, he said, the United States has no intention of shutting down the "interests sections" opened by the two countries in Washington and Havana in September. These sections serve as informal embassies, and provide a "useful and important channel of communication," he added.

Last fall, the United States complained about the increasing number of Cuban troops being sent to Angola, where a civil war still continues, and termed it an obstacle to the normalization of relations between the two countries.

Vance appealed anew yesterday for a cease-fire between Ethiopia and Somalia, a withdrawal of Somali troops from Ethiopian territory, and a corresponding withdrawal of Soviet and Cuban forces from the area. Similar U.S. appeals have been rejected by all sides in recent weeks.

Ethiopians and Somalis have contested the sparsely populated Ogaden region for almost a century and the two countries fought a short war over it in 1963 in which Ethiopia prevailed. About 90 percent of the area, about the size of Oregon and populated mainly by ethnic Somalis, was captured by Somali forces last summer.

There have been conflicting reports about the number of troops facing each other, and the progress of the fighting.

It is estimated in Addis Ababa that about 20,000 regular Ethiopian troops and more than 50,000 newly recruited members of a "peasant militia" are facing 25,000 to 30,000 Somalis.

The entire Somali army, however, has only about 30,000 troops and until this week Somali had consistently denied that its forces were involved, contending that guerrillas of the Western Somali Liberation Front were doing the actual fighting.

But Somali President Mohammed Siad Barre admitted this week in an interview with the Western German magazine Der Spiegel that Somali regulars have been sent in since Ethiopia launched its counter-offensive.

He has said 15,000 Cubans are supporting the Ethiopians - figures that are regarded by western sources as considerably exaggerated.

Siad Barre has decried the $800 million Soviet arms buildup in Ethiopia over the last year and has repeatedly appealed for matching arms from the West to little or no avail.

Neither Ethiopia nor Somalia has announced any casualty figures, but it is believed that they are high. One unconfirmed report from Mogadishu said 3,000 Somalis have been killed.

With no independent observes at the front, reports vary on the fighting widely. One report said Somali forces had fled and abandoned their equipment in the face of advancing Ethiopian troops. In Addis Ababa, the Ethiopian government called on Somali troops to give up.

Diplomatic sources in Addis Ababa said the Ethiopians were continuing to drive toward Jigjiga, a key outpost providing access to the difficult terrain in the lower Ogaden. There were other reports that the offensive was moving toward the towns of Aysha and Mello near the border with Djibouti.

Somalia has only reported small tactical retreats.

In Mogadishu, it was reported that fears of an Ethiopian invasion had faded. There was no sign that the general mobilization announced Thursday had begun and the Indian Ocean beaches were packed with weekend visitors.