Somalia is quietly buying Soviet-built arms from Egypt to help battle Soviet-backed Ethiopian troops in the disputed Ogaden desert region. The deal may have been indirectly financed in part by the West German government.

The Somalis have been pleading for arms from major Western countries but have been turned down so far, at least publicly. Officials from the United States, Britain, West Germany, France and Italy last week agreed in a Washington meeting that negotiations are the best way to end the bitter dispute between the two countries.

Nevertheless, there have been signs that the Carter administration, in particular, would not be displeased if some countries were able to supply limited amounts of arms to Somalia. Unofficial reports indicate that Iran and Saudi Arabia, both Moslem countries like Somalia and also anti-Soviet, have been supplying some arms aid.

Both those countries are equipped with vast amounts of U.S. weapons and supplies. Somalia, however, was allied with the Soviet Union for a long time before tis open conflict with Ethiopia and the Somali forces are equipped mostly with Soviet weapons and are used to handling them. Thus, the apparent purchases from Egypt could be more useful.

Bonn's possible role in Somali arms purchases emerged Sunday when Ethiopia ordered West Germany's ambassador out of the country on a 24-hour notice, in apparent retaliation for a $12 million grant from West Germany to Somalia that Ethiopia feared might be used to buy weapons.

The first unconfirmed reports of the Somali-Egyptian arrangement appeared in the conservative newspaper Die Welt here this weekend.

Today, well-placed West German government officials said privately that those reports were reliable, although they sharply dispute charges that Bonn had anything to do with it.

The situation, however, poses a potentially serious foreign policy dilemma for Bonn, whose influence in several of the world's troubled areas has remained steady because of general attempts to balance between competing interests.

West Germany remains enormously grateful to the Somali government of President Mohammed Siad Barre for allowing West German commandos to land at the Mogadishu airport last October and rescue passengers from a hijacked Lufthansa airliner.

Soon after, Bonn increased its planning economic and development aid to Somalia for 1978 from about $12 million to almost $20 million, but publicly said it would stick to its policy of not selling arms to global "areas of tension" and stay out of the bitter Ogaden conflict.

It has now been disclosed, however, that Bonn greatly accelerated its plan to get the first $12 million to Mogadishu and that it put no strings on the money. This is extremely rare for aid coming from Bonn, which normally requires a precise accounting of its aid's uses.

Thus, Bonn officials admit it is possible that Somalia could use the funds to buy arms or to free other money from other sources to buy arms.

West German officials say there have been a few other cases in which aid to very poor countries - such as Afghanistan, Mali and Bangladesh - also had no conditions. They acknowledge, however, that these were for much smaller amounts and that the Somali case is bigger, faster and more unusual.

The new developments have also led to a new look at Chancellor Helmut Schmidt's visit to Egypt early this month when he met with Egyptian President Anwar Sadat and Somalia's Siad Barre in separate discussions.

Yesterday in Rome, the deputy foreign minister of Ethiopia added to the mix by claiming in a news conference that his government was convinced there was an agreement between the United States and Saudi Arabia in which Saudi weapons bought from the United States were turned over to Egypt, which is turn passed its Soviet weapons to Somalia. These were presumably older Soviet weapons that the Egyptians could no longer use since Moscow shut off arms aid to Cairo.

If true, such transfers either would appear to be illegal, or would have to have U.S. official sanction, since U.S. policy forbids U.S. arms sold to one country from being transferred to another without specific U.S. authorization.

Yesterday, Ethiopia's ambassador to West Germany told a news conference that he doubted Bonn's claims of neutrality, asking, "It is being neutral when you are financing the invasion and destruction of Ethiopia?" The West Germans are also aware of substantial sympathy for the Ethiopian position elsewhere in Africa.

The Ethiopian ambassador, Haile Gabriel Dagne, was summoned to the foreign ministry here after he made his remarks.

The West Germans in the past had maintained generally cordial relations with Ethiopia and were involved in several cooperative economic projects.

The disclosure of the unusual economic aid to Somalia is not likely to hurt Schmidt politically at home because help for Somalia is generally popular after the Mogadishu raid. The steady press reports of a large scale build-up of Soviet and Cuban advisers and equipment in Ethiopia and U.S. criticism of the Soviet role there also have led to greater sympathy for Somalia.

Yet, the mushrooming doubts here about the precise conditions of the unusual aid to Somalia are coming only a few days after Schmidt told the parliament in his annual state-of-the-union address that Bonn would continue its policy "not to supply weapons to areas of tension in the Third World. Our greatly increased assistance is intended to contribute to a more balanced economic development. It serves no other purpose." The development aid speaker for the combined conservative opposition forces, Juergen Gerhard Todenhofer, has clearly indicated that he supports help for Somalia. Nevertheless, he has been sharply critical of Schmidt and the ruling government for taking such action in a way he views as illegal and as a deception of parliament and the public.