The Soviet Union accused President Carter yesterday of "deliberate distortion of the true state of affairs" in the conflict between Ethiopia and Somalia in the horn of Africa.

In an unusually caustic personal attack, the official Soviet news agency, Tass, pounced on Carter's charge on Thursday that the Soviet Union is engaged in "unwarranted involvement in Africa." Carter said the Soviets are shipping into Ethiopia "large quantities of weapons, some men," and are "alsto dispatching Cubans into Ethiopia who are perhaps to be contants themselves."

A commentary by Tass' senior political analyst, Yuri Kornilov, fired back that Carter "ignored the fact that an aggression had been committed" against Ethiopia by Somalia. It charged that the "Middle Eastern allies of the United States" are secretly shipping American arms to Somalia to "help to dismember" Ethiopia.

Without disputing Carter's statement that Soviet and Cuban military advisers have been sent to Ethiopia, the Soviet commentary scornfully said that Carter "permitted himself absurd and absolutely irrelevant allegations that the U.S.S.R. is 'dispatching Cubans into Ethiopis,' as though the Republic of Cuba is not a sovereign state."

This crossfire between Washington and Moscow splashes on the public record a basic conflict of interests over a strategic corner of Africa that dominates the approaches to the Suez Canal and the eastern shore of the Indian Ocean.

Until now, the United States and the Soviet Union have avoided large-scale public exchanges over the swirling turnabout in relationships in that region. Last November, Somalia expelled about 4,500 Soviet advisers, broke diplomatic ties with Cuba and ended its friendship and cooperation treaty with the Soviet Union. That cost the Soviet Union valuable naval rights on the Indian Ocean. Earlier last year, in April, Ethiopia ordered the United States to withdraw its military advisers and closed down five American facilities, and the Soviet Union replaced the United States as Ethiopia's main military supplier.

In turn, Somalia sought military assistance from the United States. President Carter initially set out to give it, in combinations with France and Britain. But the United States abruptly backed off as Somalia became heavily involved in "liberation warfare" over Ethiopia's province of Ogaden, which is ethnically Somali. This is what the Soviet Union labels "a war of agression."

Attempts by the United States and other nations to induce African leaders to initiate mediation efforts between Ethiopia and Somalia have faltered repeatedly.

According to American officials, Nigeria's minister of external affairs, Joseph N. Gerba, encountered intense Soviet hostility toward Somalia in Moscow in the late November. The Soviet Union, meantime, has been pouring weapons into Ethiopia, and Soviet and Cuban military advisers in Ethiopia are not estimated to total about 3,000, of which about one-third are Russia.

On Thursday, American officials [WORD ILLEGIBLE] intelligence sources as saying that Cuban Defense Minister Raul Castro has secretly entered Ethiopia, reportedly to help plan the use of Cuban advisers in training Ethiopians for a counter-offensive against Somalia.

It is "an open secret," Tass counter-charged yesterday, "what forces had prodded Somalia" into "frankly expansionist steps against Ethiopia . . ."

Tass said Western news services have reported that "reactionary Saudi Arabia . . . express readiness to finance the deliveries of American arms" to Somalia. The Western press "makes no secret of the fact," Tass said, "that the Middle eastern allies of the United States deliver American arms to Somalia 'in unmarked cases.'"

That charge produced a denial from the State Department yesterday that American weapons are being secretly diverted to Somalia by Iran and Saudi Arabia, which, like Somalia, , like Somalia, are Moslem countries, or by any other nation.

U.S. officials acknowledge privately that Iran and Saudi Arabia are financing or otherwise helping to supply non-American arms to Somalia, purchased on the world market or obtained from other Middle Eastern nations.

"I am afraid I am going to have to dodge that question," State Department spokesman John [WORD ILLEGIBLE] said yesterday, when asked at a [WORDS ILLEGIBLE] if Saudi ot Iranian weapon [WORDS ILLEGIBLE] to Somalia.

[WORD ILLEGIBLE] said, he could not go into details of [WORDS ILLEGIBLE] President Carter had about the Ethiopia [WORD ILLEGIBLE] conflict in his recent stops in Iran and Saudi Arabia.

"It's no secret," said the spokesman, "that the Iranians and the Saudia are very concerned about the extent of Soviet involvement in Ethiopia, as we are."

The United States is continuing efforts "to encourage both sides in the Ogaden conflict to resolve their differences by negotiation," Tratlner said, "and we have made it clear we oppose shipments of arms to the area."

He said, "We will neither supply arms to either of the contending parties in the horn, nor will we authorize the transfer to others of U.S. arms."

American sources said in November that the United States turned down requests from Iran and Saudi Arabia to shift U.S. weapons to Somalia. "We don't want to turn the Ogaden into a proxy war" with Russia, one U.S. source said yesterday.

Leaders of the two nations urged Carter on his recent visit to put greater pressure on the Soviet Union to curb the warfare. But the prospects are good, U.S. officials said.

Administration officials said, however, that they expect "to go on talking" with the Soviet Union about the conflict, despite the public outbursts this week.