The Soviet Union, once again aided by Cuba, has begun a major offensive to replace the United States as the dominant foreign power in socialist Ethiopia and to eliminate U.S. influence in the region.

But the Soviet political, military and diplomatic effort here could end in its expulsion from neighboring Somalia, where it presently has its biggest investment anywhere in black Africa.

Nearby anti-Soviet Arab states led by oil-rich Saudi Arabia are already promising Somalia massive financial and military assistance, reportedly running into the hundreds of millions of dollars, if it expels the Soviet Union as Egypt did three years ago.

Whether Moscow can straddle the bitter terriotrial dispute between Ethiopia and Somalia and simultaneously consolidate its position in the two adjacent Marxist states remains to be seen. But there is a growing feeling among Western observers here that this has become the Soviet stratgy in the explosive Horn of Africa now that Ethiopia has declared itself in favor of a Marxist revolution.

The transition of Ethiopia from a conservative monarchy to a radical socialist state seems to have upset all the traditional big-and small-power relationships in the entire Red Sea region, stretching from Egypt in the far north to Somalia in the south.

At stake in this political and diplomatic upheaval is not only the fate of this country's budding socialist revolution but also the outcome of the civil war in its northernmost province of Eritrea and a possible Ethiopian-Somali war over the strategically placed French Territory of the Afars and Issas that is to become independent within a few months.

Diplomatic speculation includes the possibility of a superpower flip-flop in the Horn of Africa, with the Soviets moving into Ethiopia and the Americans taking their place in Somalia right now, this country is still totally dependent on the United States for its heavy arms, just as Somalia is dependent on the Soviet Union.

The Horn of Africa has traditionally been defined as including Ethiopia, Somalia and the tiny French territory. But with Saudi Arabia, Egypt and the Sudan increasingly involved in the affairs of Ethiopia and Somalia, the politics of the Horn have now become deeply enmeshed in those of the entire northeast portion of the continent and the Red Sea region as well.

Another topic of diplomatic debate is the likelihood of PAX SOVIETICA being imposed on Ethiopia and Somalia once the Soviet Union gains sufficient leverage here.

There are reports that the Soviets are proposing a federation of the two countries as a possible way out of their 17-year-old feud over Ethiopia's eastern Ogaden region, to which Mogadishu lays claim as part of its dream of a Greater Somalia also incorporating the French territory and a slice of northern Kenya.

In addition, it appears that Moscow has also suggested that a status within a united Ethiopia somewhat comparable to the Ukraine or Byelorussia within the Soviet Union of socialist republics.

Meanwhile, the priority being given by the Carter administration to the human-rights issue, as well as its questioning of past American arms-sales policy, is playing nicely into the Soviet strategy here. U.S. Secretary of State Cyprus R. Vance said Thursday he would recommend the elimination of grant military assistance to Ethiopia (about $6 million this fiscal year) because of human rights violations here.

U.S. military assistance is the main remaining source of American influence in this country so that any cutback is certain to decrease its leverage.

The socialist revolution here has involved numerous summary executions, the slaying of two chiefs of state and widespread assassinations of both pro- and anti-government officials, students and labor union leaders. The revolution has badly fragmented Ethiopian society into warring factions, each seeking to eliminate the other and seize power.

In addition, the civil war in Eritrea has bred military excesses and a desregard for human rights while the central government struggles to maintain Ethiopia's national unity.

For the past 25 years, the United States has been Ethiopia's main arms supplier providing more than $210 million worth of tanks, planes and smaller arms. It still has a 46-man military advisory mission aiding the Ethiopian Armed forces. In addition, this country has purchased more than $150 worth of M-60 tanks, F-5E jet fighters, radar equipment and other war materiel in the past two years, making Ethiopia the largest purchaser of American arms in black Africa.

Whether it will now remain so is extremely uncertain. U.S. Deputy Assistant Secretary of State for African Affairs, Talcott W. Seelye, was here last week on a fact-finding mission that ended without his meeting any top officer of the ruling Military Council, despite his request for an appointment with its new chairman, Lt. Col. Mengistu Haile Mariam.

Seelye reportedly received a warm reception from lower-rank civilian and military officials, however.

The Soviet plan for displacing American influence here appears to have been precipitated by the bloody confrontation Feb. 3 among top members of the military council. That conflict left the chairman, Brig. Gen. Teferi Bante and six others dead, and resulted in the emergence of Mengistu as the country's strongman.

The colonel, 39, is apparently convinced that the U.S. Central Intelligence Agency is behind all the groups opposed to him, including the anti-Marxist Ethiopian Democratic Union, the extreme-leftist Ethiopian People's Revolution Party and the Arab-backed Eritrean Liberation Front. In his first speech following what is known here the CIA of mastermining the plot and acting through "reactionary (Arab) forces" in the region in league with these three disparate groups.

The CIA is now being castigated in government propaganda as a prime conspirator against Ethiopia's socialist revolution and is constantly being mentioned whenever the names of the opposition groups crop up.

Within 24 hours of his victory, Mengistu received a personal message from Cuban President Fidel Castro congratulating him and expressing strong support for Ethiopia's revolution. The first two ambassadors to be received by Mengistu were Cuba's Jose Ferez Novoa and the Soviet Union's Anatoli P. Ratanov.

This apparently was the signal for a flood of congratulatory messages to Mengistu from presidents of all the Soviet bloc states, plus Yugoslavia, North Korea and China.

Shortly afterward, East German Communist Party political bureau member Werner came to Addis Ababa nomic and technical assistance, and on a follow-up mission offering eco- there is now a five-man Cuban delegation here led by Gen. Arnaldo Ochoa, a Communist Party Central Committee member.

It appears that Mengistu has finally gotten the seal of Soviet approval for himself and the Ethiopian revolution, something he and his civilian Marxist advisers have been desperately seeking for the past year.

The Soviets have also begun shipping small arms to Ethiopia to help defend the revolution from its internal enemies and it appears that much bigger things are in the works in terms of military assistance. Mengistu is reportedly planning a trip to Moscow soon and he could well sign an arms agreement then.

Other Communist countries, however, are bidding for influence with the military government, too. These include nonaligned Yugoslavia and China, both of which have also begun supplying Ethiopia with small arms. The council's new vice chairman, Lt. Col. Atnafu Abate, is presently in Yugoslavia on a state visit, the first by any member of the new leadership since the Feb. 3 shakeup.

Just how Somalia will react to the Soviet Union providing arms to Ethiopia and moving politically closer to its prime enemy remains to be seen. Reports reaching here from Mogadishu say Somali leaders are not at all happy with the latest Ethiopian developments and are watching closely the Soviet maneuvers here.

But it is doubted here that Somalia would dare to oust the Soviets now with the possibility of a war with Ethiopia over the fate of the French territory of Afars and Issas looming. More likely, any Somali move to oust the Soviets would take place, if it does come at all, after the French territory issue is resolved this summer.

This gives Moscow some time to maneuver in its new relationship with Ethiopia before it is likely to face any serious crisis with Somalia.

It is doubted here that Moscow really wants to see the United States leave Ethiopia. A U.S. departure would place a bigger military burden on Soviet shoulders and it might force the Soviets to choose between losing its prized Indian Ocean air and seaport facilities in Somalia and gaining a new ally here of uncertain survival.

A more gradual transition, it is felt here, would allow Somalia time to adjust to, and perhaps accept, the new division of Soviet favors in the region. It would also give Ethiopia time to switch more gradually from American to Soviet arms.