Algeria has given Nicaragua as many as 30 Soviet-made tanks and large quantities of other arms, according to Sandinista government and Third World diplomatic sources here.

The Algerian-backed military buildup is part of what one Latin ambassador called an "Arab offensive" that has inserted an entirely new element into the economic, military and political life of an area where outside influences until now have been largely restricted to regional neighbors and the two super-powers.

Iraq is considering a major aid program in Nicaragua, Sandinista officials said, although no concrete agreement has been reached yet. Already, Libya has deposited $100 million in Nicaragua's Central Bank to shore up the Sandinistas' faltering economy and may invest hundreds of millions more in agricultural projects, according to Nicaraguan government sources.

The Palestine Liberation Organization, which now has a resident ambassador in Managua, was instrumental in introducing the Sandinistas to the Arab revolutionary states as a source of vitally needed aids, according to Moises Hassan, a former Nicaraguan junta member and the current construction minister.

On the eve of their second anniversary in power, the Sandinistas find themselves burdened with serious economic problems, fearful of military challenges from neighboring states and, according to sources here, troubled by disagreements within their collegial government about the path their revolution should take.

With U.S. aid cut off and only meager financial help coming from the Soviet Union -- which was originally believed to have supplied the tanks that came from Algeria -- the Sandinistas have turned to the revolutionary Arab governments to supply support that may help them survive without aligningwith either of the superpowers.

The Sandinistas' warm relations with Cuba -- especially the close indentification of the most powerful members of the Sandinista leadership, Daniel and Humberto Ortega, with Fidel Castro -- is viewed in Washington as a growing link to Moscow because of Cuba's economic dependence on the Soviets.

Nevertheless, the Sandinistas, some Arab diplomats and reportedly Castro himself see the relationship quite differently. Although the Sandinista leadership generally has a socialist and Marxist orientation, a large segment recognizes the dangers of close Soviet ties.

One Third World diplomat familiar with both Cuba and Nicaragua recently speculated privately that "Fidel is watching very closely to see what happens with Nicaragua and the Arabs. He cannot be happy about his dependence on the Soviets and he cannot turn to the United States. But if the Arabs do it for Nicaragua then I have no doubt he would seek the same way out for himself."

For the moment, Castro's government is receiving approximately $10 million a day from the Soviets. One Arab diplomat described the relationship with a Moroccan proverb: "The hand you can't bite, you kiss." But Nicaragua thus far has received very little direct Soviet aid. A recent credit line from Moscow amounts to only $50 million, according to diplomatic sources.

Foreign economic analysts estimate that Nicaragua will need as much as $400 million next year above and beyond the current aid it is receiving just to keep the economy at its present subsistence level of activity.

Other nations have continued to support the Nicaraguan rulers.Mexico, for example, has in effect contributed $150 million to the economy this year through concessional oil deals, according to foreign analysts. But the Arabs have the most money to spare and the advantage of what the Nicarguans like to call "revolutionary solidarity."

Construction Minister Hassan, who declined to comment on the specific arrangements between Nicaragua and the revolutionary Arab states, did attempt to explain their motivation in helping a small Central American nation thousands of miles away.

There is a common interest among us," Hassan said Friday. "We all know how fragile we are, how fragile is our independence. Libya, Algeria, Nicaragua, the Palestinians have known what it is to be the subjects of foreign powers or their representatives.

"I think this is probably difficult for a country like the United States to understand because it has never suffered very much," Hassan said. "It must be difficult for a normal American to comprehend how a country feels that for many years has seen iteself as a subject.

"We know that we are a weak country economically and militarily," he continued. "Independence is not yet completely achieved. We know that the major powers don't want to recognize that we are free."

The Reagan administration repeatedly has argued that Libya provides support for international terrorism, a charge Libyan leader Muammar Qaddafi hotly denies. In any case, the argument does not seem to concern the Nicaraguans.

On June 20 the Sandinista leadership held a public celebration here in Managua marking the 11th anniversary of Qaddafi's ouster of U.S. air bases from Libyan territory.

"The ties between the Libyan people and the Nicaraguan people are not new," junta member Sergio Ramirez told the rally, "but were consolidated when the Sandinista front struggled in the field of battle to win the liberty of our homeland. The solidarity of the Libyan people, of the Libyan government and comrade Muammar Qaddafi was always patently mainifest."

"This solidarity has been made real, has been made effective, has been made more fraternal since the triumph of our revolution," Ramirez said.

The Libyans seem linked most closely to what is known as the ""prolonged popular war'' faction of the Sandinista front. Both Hassan, whose father was Palestinian, and Tomas Borge, who has visited Libya and who recently made the official announcement of the $100 million deposit in the Central Bank, belonged to that faction.

Although the complex internal politics of the nine-member Sandinista Directorate remain obscure, there is speculation in diplomatic circles that the Arab role in aiding Nicaragua could strengthen the hand of Borge and his followers. Ibrahim Mohammed Farhat, Libya's ranking diplomatic representative here (Libya no longer has formal ambassadors), repeatly alluded to Libya's particular friendship with Borge in his June 20 speech.

According to diplomatic and Sandinista sources, Libya is now considering a series of joint agricultural ventures in Nicaragua that could be worth $300 million to $3 billion, but no firm agreements have been made yet. One source said a fledgling joint venture in forestry, begun recently by the Mexicans and Nicaraguans, is being watched closely by Libya as a possible model.

Diplomatic sources who are in close contact with the Sandinista leadership say that an agrarian reform program to be announced Sunday is considerably more moderate than one originally prposed by some of Nicaragua's more radical Marxist planners.

The original plan would have been oriented essentially toward producing products complimentary to the needs of the Soviet Bloc countries. Libyan aid may be expected to change that orientation, according to one well-informed Sandinista source.

Qaddafi appears to be contributing money to Nicaragua for reasons of revolutionary solidarity or, as one Latin diplomat speculated, because he "wants to project his image as a world leader."

The motive for the Algerian arms shipments is altogether unclear. Algerian Ambassador Bushir Ouldruis would not comment on specific aspects of his country's aid to Nicaragua except to say, "We are not acting as the agents of anyone."

The arrival of Algerian ships bearing arms at the east coast port of Bluefields has been commonplace for almost a year.

According to diplomatic and Sandinista sources, however, Soviet T55, 36-ton tanks began arriving here only in the last month. Estimates of the total number now on hand vary, but one usually reliable government source said earlier this week that 18 have arrived and 12 more are on the way.

There is no available evidence that Soviet Mig fighters have arrived, although there have been reports that some Nicaraguan airfields have been modified to accomodate them.

The tanks were delivered only after Honduras, with which Nicaragua has increasingly tense relations, acquired 16 British Scorpion light tanks. But the steady buildup of the Nicaraguan armed forces already has provoked concern by leaders throughout the region, including Panamanian Gen. Omar Torrijos, who is sympathetic to the Sandinista government. Right-wing politicians in Guatemala, who hate the Sandinistas, are openly talking about increasing the size of the Guatemalan Army from 16,000 to 60,000 men in the face of Sandinista claims to be organizing a standing force of 50,000 and militias of 200,000.

In fact, government and diplomatic sources maintain that the current strength of Nicaragua's Army is less than 25,000, and the militias probably number little more than that.

Whatever Algeria's reasons for getting involved in Nicaragua, the PLO was involved in most of the Sandinistas' original contacts with the Arab world. Hassan said Friday that a "select group" of Sandinistas, numbering perhaps a dozen altogether, began training with the PLO in Lebanon and elsewhere as far back as the late 1960s.

At a crucial moment in the Sandinistas final offensive in June 1979, Rogelio Ramirez, brother of junta member Sergio Ramirez, asked the PLO for a planeload of weapons to be used on the southern front. It was sent but never arrived, because the American pilot of the commercial aircraft, who reportedly had thought he would be transporting food and medical aid, turned it over to authorities in Tunis. Hassan blamed the U.S. Central Intelligence Agency.

Relations with the PLO later grew warmer. A year ago, PLO leader Yasser Arafat visited Managua, and formal diplomatic relations were established. Marwan Tahbub, a senior Palestinian diplomat, has been in residence as ambassador here since January. He declined to comment on his orgnanization's relations with Nicaragua.

Whether Arab support ultimately will allow Nicaragua to resurrect its economy and avoid what it considers the pitfalls of superpower alignment remains an open question. But the presence of the Arabs here is strong and growing stronger, and it has caused both diplomats and government officials to remark privately that they are surprised the United States was never able to do what the Arabs are now trying to do.

"After the [Sandinistas] triumph the United States could have bought Nicaragua for the price of one atomic submarine," one South American diplomat said. But the chances of Washington doing that now are virtually nonexistent.

"If Nicaragua can make it with the Arabs it's not a bad strategy for them," said one Western economic analyst. "Even if this country turned around ideologically 180 degrees overnight I don't see, with present budget restraints, the U.S. giving them the kind of money the Arabs might. This could at least keep them out of the Soviet Bloc. In fact it's a very good strategy for them to follow."