The United States and Brazil, traditionally regarded as close friends and allies, have entered a new and important era in their relations.

The United States, many diplomatic observers here believe, will have to promote Brazil to the "big leagues" of its foreign policy and perhaps reconsider some of its major policy positions, or else it could be faced with a powerful adversary in South America.

The overwhelming issue dividing the two countries is advanced nuclear technology. Brazil, which harbors serious ambitions of becoming a major world power, wants to be self-sufficient in energy by the 21st century. The United States is opposed to this, because it feels that the presence of fissionable atomic fuel in Brazil will increase the chances of a nuclear war.

Government officials and foreign diplomats here in the Brazilian capital make it clear that this is a major quarrel. One ambassador said it is "a clash of national wills and national goals -- for the first time ever -- between Brazil and the United States."

If the conflict is aggravated, observers here believe, Brazilian nationalism and even anti-Americanism could increase to a degree never before imagined.

Brazil has signed an umprecedented $10 billion agreement with West Germany to acquire the capability to make its own enriched uranium fuel for nuclear-powered electricity generators and also to reprocess used nuclear fuel to produce more fuel.

To Washington, Brazil's nuclear aspirations represent a serious international danger. One component of the nuclear know-how Brazil is to get --the fuel-reprocessing plant -- is so advanced, it does not even exist on a commercial scale in the United States. Such a plant conceivably could be used to produce plutonium for atom bombs.

President Carter, who recently said he will block federal funding for a private nuclear reprocessing plant in South Carolina on the ground that this technology is unnecessary and potentially dangerous even for America, is committed to stopping Brazil from getting its hands on the process.

Brazil regards the U.S. postion as one of paternalism and even envy. Brazil has said repeatedly that it will not make bombs. Brazil points out that its agreement with West Germany commits both sides to use nuclear energy only for peaceful means and is under the supervision of the U.N.-affiliated International Atomic Energy Agency.

"Americans are surprised to see this little boy suddenly acting like an adult," a Brazilian government spokesman said of the present state of affairs between his country and the United States.

Official tempers in the two countries flared recently, when the U.S. State Department investigated and reported on the human-rights situation in Brazil, in accordance with a U.S. law concerning military aid. Brazil regarded this as "interference" in its internal affairs and responded by rejecting U.S. military assistance and breaking off a minor U.S.-Brazilian military defense pact.

Brazil's reaction was very popular internally. The anti-communist, normally pro-American, but at times faction-ridden armed forces, which have run this country for the past 13 years, unanimously supported President Ernesto Geisel, an ex-army general, in his tough posture.

Even civilian critics of the president, including human-rights advocates from the one legal opposition political party, tended to back Brazilian nationalism and sovereignty, rather than trying to reap internal benefits from Carter's human-rights campaign. Anti-American articles started popping up in the Brazilian press, although the government later took steps to curtail this.

The consensus of Brasilia insiders is that what provoked this confrontation was not human rights at all, but rather the nuclear issue. The fact is that the State Department's criticism of Brazil on the human-rights front was quite mild. The report even praised Geisel for eliminating most torture of political prisoners here.

"The human-rights affair was a convenient pretext for Brazil to let the United States know it will sacrifice an old friendship, if necessary, to achieve its nuclear goals," said a well-connected Brazilian who once held a high government post. "The nuclear issue is everything."

Brazil has already demonstrated that despite its long and strong ties to the United States, it will act contrary to American desires for its own important self-interests.

For example, Brazil immediately recognized Agostinho Neto's Cuban-backed Popular Movement for the Liberation of Angola after it proclaimed victory in that African country's civil war. This upset Washington, which was hoping that a non-Marxist Angolan group would win even at the last minute. Brazil voted in favor of the controversial U.N. resolution equating Zionism with racism, despite strong U.S. pressure to get it defeated. Moreover, Brazil now says it will sell military equipment to Chile, which is on the U.S. military sales blacklist because of human-rights violations.

Both sides say they will meet to talk further about the nuclear issue, although no specific date has been set.

President Carter recently sent Geisel some personal letters, although neither government will reveal what was in them. This is seen as a private way of keeping channels of communication open.

A widening of the rift between Brazil and the United States, however, could cause important military trade and political power realignments.

On the military side, the Pentagon is studying internal regulations to determine whether Brazil will suffer any restrictions in the U.S. military market because of its rejection of the military assistance program.

There is a possibility Brazil will not be able to get any more replacement parts for its American F-5E jet fighters. Should this occur, Brazil probably will turn more toward Britain, France and West Germany for military hardware.

As for commercial relations, American and Brazilian businessmen and economic officials say they hope things will continue at their present good level. Finance Minister, Mario Henrique Simonsen recently met in the United States with Treasury Secretary Michael Blumenthal, officials of the World Bank, and the president of Chase Manhattan Bank, David Rockefeller. He returned highly optimistic about future loans.

Should there be business difficulties arising from this political differences, Brazil would be well protected against American economic pressure. It has more trade with the European Common Market than with the United States, and it is receiving a sizable amount of loans and investment from Western Europe and Japan.

Finally, if the nuclear talks fail and if the United States succeeds in torpedoing the deal for the West German enrichment and reprocessing plants, Brazil has declared it will go it alone in the nuclear field, not subject to international supervision. This is interpreted as a veiled threat to build a bomb.