In faraway places like China, an Argentine diplomat here said, the Argentine and Brazilian ambassadors are often best friends.

When Argentina and Brazil face human rights criticism in world forums, or the outside economic adversity that plagues all developing countries, Latin American's two big nations frequently join forces.

But like siblings who stick up for each other against outsiders, when Argentina and Brazil sit down across the Latin American family table, sparks begin to fly.

For more than 150 years since their independence, and even as colonies of Spain and Portugal, the two Latin giants have bickered, challenged each other and at times even come to blows.

The current sore point is the Parana River, the world's eighth longest and - the Amazon remaining largely undeveloped - the most important waterway in South America. The parana begins in Brazil and ends in Argentinaa, where it pours into an estuary of the Atlantic above Buenos Aires.

Decades ago, Argentine engineers developed vague plans to build a dam on the Parana at the town Corpus, 200 miles downstream from the Brazilian border. Two years ago, while Argentina's plans were still gathering dust, Brazil began to build its own dam 218 miles north of the Argentine site.On completion in 1983 the Brazilian dam, called Itaipu, will be the largest hydroelectric facility in the world.

Argentina maintains that Itaipu not only could upset its plans for a dam downstream, but could alter the entire flow of the Parana, which provides water and transportation for seven large Argentine cities. Despite an applicable waterways accord between the two, Argentina says it was never notified or consulted about Brazil's plans.

Brazil's rather cavelier answer is that there was no reason to tell Argentina. "We don't have to coordinate anything with them," a Brazilian official said.

While the Parana may be just one of several important rivers in Brazil, the Argentine said, "it is THE river in Argentina." Unless something is done, Argentina has said it might build its Corpus dam so high that Itaipu's potential power output could be reduced by as much as one-tenth.

The Itaipu-Corpus battle has made headlines in the two countries since plans for Itaipu were first announced nearly five years ago, provoking such heated outbreaks as one the local press dubbed "the bathing trunks war" in 1973, and this year's "truck war."

A harsh Argentine statement in 1973 accused Brazil of violating the waterways accord with its announced Itaipu plans. The Brazalian minister, the statement bitterly complained, not only transmitted the news verbally to the Argentine ambassador, but did it "while clad in bathing trunks" at the embassy residence.

Brazil officially refused to respond, but a Brazilian newspaper noted at the time that, while the minister arrived in "normal informal attire," described as a sports coat and no tie, he found the ambassador in the pool. After a swim, the paper said, the news was transmitted over a a fully-dressed luncheon.

The ongoing "truck war" began last spring, when Argentina closed a tunnel across its Andean border with Chile to Brazilian truck traffic on grounds that Argentina deserved just compensation for Brazilian commercial use of its roads. Brazil then threatened to close all of its borders to Argentine vehicles. The disagreement was widely attributed to bad feelings caused by the Itaipu-Corpus dispute.

"The logical solution is to put the river in common," said the Argentine diplomat, "to put it its resources in a pool and divide the benefits. In well-developed countries, the trend between neighbors is to integrate. In underdeveloped countries, there is a tradition of suspicion and rivalry."

High-strung and fiercely proud of their European heritage, Argentines often find Brazilians loud and uncouth. Brazilians think of themselves as the energetic descendants of American 19th century frontiersmen and entreprenuers, and often view the Argentines as decadent and past their prime.

Forty years ago, Argentina epitomized Latin America's development promise, while Brazil was still struggling to tame its vast unmapped territory and deal with a plantation economy. Today, Brazil is considered the development leader, while Argentina has fallen behind following tumultuous decades of political strife.

So great is Brazil's current power in latin America that many of its Spanish-speaking neighbors fear expansionist designs. The dam troubles, the Argentine diplomat said, "are all mixed in with the old struggle for influence over Paraguay and Uruguay."

Two small countries straddling the Brazilian-Argentine border, Paraguay and Uruguay owe their existence primarily to territorual rivalry between their two large neighbors. Both were disputed areas between early Spanish and Portuguese colonials, and the battles were carried over after independence.

The Parana River, at the Itaipu site, forms part of the Paraguay-Brazil border. Further south, the river forms the border between Paraguay and Argentina. Both Itaipu and Corpus dams will stand halfway in Paraguay.

Paraguay intends to sell back most of its share if the enormous amounts of electricity generated by each dam to its builder, and here the issue comes complicated. While Brazil's current is 60 cycles, Argentina and Paraguay use 50-cycle current. Would Paraguay, under Brazilian influence, change its electrical system to accomodate the soon finished Brazilian dam, thus making it harder for Argentina to strike a Paraguayan deal for the plannedd Corpus, and, in Argentine eyes, increasing Brazilian control over Paraguay?

The "war of the cycles" ended recently when Brazil, after some careful engineering arithmetic, agreed last fall to install half of Itaipu's 18 giant turbines at 50 cycles.

The problems of dam heights and alterations in river flow are now on the table, and while technicians say it can all be worked out, a recent ministerial meeting between the parties failed to reach an accord.

"It's a rather anachronistic debate," the Argentine said.