President Reagan called his wide-ranging trip to Latin America, a region with which he was previously unfamiliar, "real fruitful." Secretary of State George P. Shultz said Reagan had succeeded in his central purpose of dramatizing "the importance of democracy in our hemisphere."

But what the five-day odyssey may have done most of all is inform the president of the United States about the vast divergence in political outlook and accomplishments among hemispheric nations he had previously lumped under the label "Latin American."

Returning on Air Force One from Honduras late Saturday night after a meeting with the military ruler of Guatemala, whom Reagan praised as being devoted to democracy, the president was asked by a reporter whether his trip had changed his views on Latin America.

"Well, I learned a lot," Reagan replied. "That's what I wanted to do. I didn't go down there with any plan for the Americas, or anything. I went down to find out from them and learn their views. You'd be surprised. They're all individual countries."

Reagan's surprise seemed genuine. Over and over again along the way, he expressed enthusiasm in what he was seeing for the first time, and his aides found it appealing and naive.

Michael K. Deaver, Reagan's deputy chief of staff and the aide considered personally closest to him, said he had never seen Reagan "quite so excited about a trip."

Repeatedly, Reagan exclaimed about the vastness of the South American continent and its physical beauty. Landing in Bogota, he compared the towering mountains surrounding the city with the Santa Monica Mountains that ring Los Angeles. His public talk about "a dream" in which nations of the New World would work together for a common purpose was matched by a similar simplicity in his private remarks.

"It was totally different from the European trip," Deaver said. "He seemed to have a chemistry with these people."

Another Reagan intimate said the president had enjoyed his meetings with Brazilian President Joao Figueiredo, with whom he rode horses and swapped cavalry stories, more than any other of his presidency.

"Reagan is really a gentleman," said a Brazil foreign ministry official who said he was "surprised" by Reagan's personal qualities. " . . . Beyond that, while he's talking, he's a very charming person. I'm not a Reaganite, but he made a good impression."

The same official, however, dismissed Reagan's view of the world as outdated and seemed amused at the U.S. view that Brazil, a superpower of the future, could somehow become "a bridge" for the United States in South America.

"If you look at a map, you will see that we cannot be detached from the South American continent," this official said. "We are not a bridge from South America; we are in South America."

Whether Reagan understood this was open to question. While he has a California politician's outlook extending south to Mexico and west to Asia rather than east to Europe, his foreign policy views remain grounded in the World War II alliance.

In Brazil, Reagan talked hopefully of restoring the U.S.-Brazilian military alliance forged in that war and ended by the Brazilians in anger at President Carter. Brazilian government leaders made no secret that they preferred Reagan to Carter. But they also indicated that Brazil wants technology to pursue its own future rather than restoration of a past alliance.

Reagan's discoveries during the Central American portion of his visit were even more startling than those in Brazil. In San Pedro Sula Saturday, he met with Honduran President Roberto Suazo Cordova and Guatemalan President Efrain Rios Montt.

Rios Montt is leader of the junta that overthrew an elected government, and some administration officials were jittery about the visit, recognizing that it somewhat undercut the trip's stated theme of hemispheric democracy.

They were relieved that the meeting took place so late that it was likely to be underreported in the eastern United States, particularly on television.

But Reagan, always impressed by any leader who tells him he is facing a communist menace, was not restrained by such concerns. On Air Force One returning to Andrews Air Force Base, he said Rios Montt had been getting "a bum rap" and "is totally dedicated to democracy in Guatemala."

For good measure, Reagan suggested that he is thinking of restoring the military aid denied Guatemala by Carter for human rights violations.

This request is likely to face a skeptical audience in a Congress that may not share Reagan's enthusiasm for Rios Montt's virtues. Senate Appropriations Committee Chairman Mark O. Hatfield (R-Ore.) said yesterday on NBC's "Meet The Press" that he would oppose resumption of military aid to Guatemala because of its record on human rights.

Rep. Steven Solarz (D-N.Y.), a member of the House Foreign Relations Committee, predicted Congress will stop Reagan from resuming military aid to Guatemala. "I think it makes a mockery of our pretensions to support the cause of human rights in Central America when we provide military assistance to a government like the one in Guatemala whose security forces are responsible for the massacre of literally thousands of their own people," Solarz told ABC News.

Despite Reagan's discovery that the nations he visited are "individual countries," the administration tried to link the trip's disparate purposes under the encompassing theme described by Shultz as "the emphasis on democracy in our hemisphere."

In fact, the Reagan trip was really two trips in one.

The first was to South America, where Reagan and Figueiredo met as equals and members of both delegations unpatronizingly expressed admiration for each nation's accomplishments and resources. The second trip was to Central America, where U.S. officials called the tune and set the tone as unabashedly as they had once done in South Vietnam.

Reagan made no effort in Brazil to stress his unyielding anti-communism or his preoccupation with U.S.-Soviet competition. He focused, as his hosts wanted him to, on economic issues.

Reagan listened unruffled as Figueiredo used an exchange of toasts to remind his visitor that Brazil's appreciation for economic help did not signal loosening of Brazilian ties with Angola or Cuba. In Bogota, Reagan reacted with calm and moderation when Colombian President Belisario Betancur bluntly told him to his face that the United States should change its economic and social policies in the region.

Security was taut in Bogota, where Colombian military forces stood guard with troops and tanks. There never was any question that Colombian authorities were in charge of the visit.

White House officials were forced to pass through metal detectors, and U.S. Embassy officials were ignored when they attemped to admit reporters into the press center on the basis of U.S. credentials.

But it was different in Costa Rica and Honduras. In San Jose, the city's best resort hotel was made part of the U.S. Embassy for the visit, and flights from the airport were regulated at U.S. request.

In San Pedro Sula, the U.S. Secret Service inspected the rifles of every member of the Honduran honor guard to see that they were not loaded, and access to the airport was strictly limited by a U.S. Embassy directive published in the local newspaper.

These arrangements reflected the continuing U.S. presence in Central America, a region historically dominated by the United States. But it is not evident that they made a big impression on Reagan.

What unquestionably did impress the president was Brazil.

"He was really dazzled by Brazil and the potential there," said Deaver, who observed that seeing Brazil made a far deeper impression on Reagan than could any briefing papers.

Reagan has always been more susceptible to personal impressions than to briefings and, for this reason rather than any laundry list of accomplishments, those closest to Reagan count his trip a success.

Reagan returned home with a conviction based on personal experience and summarized by Deaver, who said "that the real future lies here in the Americas."