Former president Jimmy Carter says he did the right thing in holding his tongue about the policies of his successor in the early months of the new administration, allowing President Reagan to swing around to views "reasonably compatible" with Carter's on a number of major foreign policy questions.

Citing the Middle East peace process, proliferation of nuclear weapons and the China-Taiwan issue as examples of Reagan administration shifts, Carter said, "I think they would have found it much more difficult to evolve their present policies . . . had I spoken out in a combative way or a critical way" about the administration's initial tendencies.

Carter, who has had no contact with Reagan since turning over the presidency Jan. 20, attributed modifications in his successor's policies in part to "experience in the Oval Office" that required changes from campaign rhetoric.

Another reason he has said so little in public, according to Carter, is his belief that other Democrats such as Walter Mondale and Sens. Edward M. Kennedy (Mass.) and John Glenn (Ohio) need their day in the sun. "There's plenty of time for me in the future to voice my own views if I see fit," Carter said.

Asked if he is thinking ever of running for president again, Carter replied: "No. I don't have any ambitions to run for public office."

A relaxed Carter, on a China-Japan journey that is his first overseas trip since leaving the White House, looked back on his administration of foreign affairs and ahead to the future in an interview Saturday night.

The interview took place over a Chinese meal and coffee in spacious, comfortable quarters at a government guest house where Mao Tse-tung used to stay in historic Xi'an, about 700 miles west of here. Carter wore a multicolored sports shirt and slacks and a big grin after catching two big carp in the guest house pond and then finding one of them in Chinese-style broth on his dinner table. Late today Carter and his party flew to Shanghai.

The former president discussed the crisis in Iran, especially his fateful decision to admit the shah to the United States, at some length for the first time since the freeing of the U.S. hostages on Inauguration Day. And he spoke anew of his surprise at the Soviet invasion of Afghanistan, which he called "a radical departure" from previous Soviet policy and a surprise to all his advisers.

Speaking of the foreign leaders with whom he dealt as president, Carter called Egyptian President Anwar Sadat "my favorite of all," describing him as "completely honest, unrestrained, decisive and cooperative." Carter said he had discussed "in depth" with Sadat his possible courses of action after regaining the remainder of the occupied Sinai from Israel next spring under the Egyptian-Israeli peace treaty. "I don't think Sadat would do anything to deviate from the accords, even after obtaining the territory," said Carter. "I have absolute confidence in him."

Carter now admits to "a series of sometimes highly emotional confrontations with strongly felt opposing opinions" with Israeli Prime Minister Menachem Begin. After easily reaching agreements with Sadat, "I would spend days or weeks or months negotiating with Begin, often with his own advisers being more amenable to an agreement than was he."

At the same time, Carter called Begin "an extremely courageous man who made decisions for the well-being of Mideast peace that sometimes were in contravention of his longstanding political alignments."

The former president, who said he considered writing a book on the Middle East but was convinced by his publishers to write general memoirs instead, is deeply convinced that the contending parties must grapple with the Palestinian problem. "There is no way to have permanent peace in the Middle East without resolving the Palestinian issue," he said, repeating for emphasis, "No way."

Soviet President Leonid Brezhnev, whom Carter met at Vienna for the signing of the SALT II treaty in mid-1979, was a surprise to Carter. "He was much more vigorous than had been reported to me by other foreign leaders with whom he had met." Brezhnev was "obviously in charge" of his delegation, seeming to make the final decision on contentious points, and "he had a sense of humor," Carter recalled.

"Though it is politically popular to condemn everything about the Soviets these days, I was convinced then and I still am convinced that Brezhnev desires peace," Carter said. "I could see in his remarks and his attitude a deep memory of the 20 million Russians who were killed during World War II and a deep desire to avoid another world conflict."

The former president expressed disapproval of two elements of Reagan administration policy toward the Russians: the "enormous" escalation of military spending, and failure to pursue strategic arms control "without hesitation."

"I felt that the Soviets negotiated in good faith and constructively on the SALT II treaty. I believe it's to the advantage of our country to observe its terms, and I don't believe it would be possible to negotiate a better treaty under existing circumstances," Carter said.

Asked where the Soviet-American relationship went awry, the former president singled out "two serious mistakes which in my judgment terminated the peaceful progress that was exemplified by the SALT II treaty signing." These were the Soviet invasion of Afghanistan and the "sponsoring" of the Vietnamese invasion of Cambodia.

He added that he had come to believe since then that "had the Soviets not gone into Afghanistan and been condemned on a worldwide basis, they would have invaded Poland." He declined to give his reasons for this assessment.

It was the painful subject of Iran, which consumed much of Carter's time and political capital in the year before last November's election, which drew the greatest amount of detailed recollection from the former president.

Carter said he had no doubt that the Iranian revolution, "causing the doubling of oil prices, enormous and uncontrollable inflation and the seizure of the hostages" was a major factor in his failure to be reelected.

In their first meeting in 1977, Carter recalled, he counseled the shah in a general Cabinet room session and privately in his inner office "to broaden his contacts among the Iranian people." Carter said the monarch was urged to broaden his circle of advisers, provide access to expression and influence from Iranian religious leaders and to the swiftly growing middle class which "still had no voice" in the nation's affairs.

The shah "didn't agree that this change was necessary," recalled Carter. The former president flatly rejected charges that his human rights emphasis contributed to the monarch's downfall, saying "I don't believe that the pointing out of the need to honor the rights of his people caused his downfall. If there was a cause, it was because he failed to honor the demands of his own people."

"I don't know of anybody who foresaw" the fall of the shah, Carter said. "If there were those who did, they didn't reveal their foresight to me. That includes the press, private senior statesmen, the intelligence community and the State Department."

When the shah did fall, Carter said, "there was no hesitation on my part in offering him a haven." The ex-president said he helped arrange a place for the shah at the Annenberg estate in California, and personally gave permission for his airplane to be refueled at Andrews Air Force base en route to California.

"At the last minute, a surprise to us, he decided to stay in Egypt" where he had flown from Tehran, Carter said. "Later we still offered him a place to stay, but he said he wanted to go to Morocco."

Carter said that "after the Iranian revolution was implanted," he decided it would be a mistake for the shah to come to the United States, which would "rearouse the fervent pitch of animosity in Iran against American citizens." So when the shah asked to come to the United States after Morocco, "my own preference was that he go somewhere else."

"We contacted about 15 countries, trying to find a suitable place for the shah to reside," said Carter. After a stay in the Bahamas, the shah went to Panama, which accepted him "perhaps out of gratitude toward me" arising from the Panama Canal treaties and "against their better judgment," said Carter.

When then-Secretary of State Cyrus R. Vance said that the shah "needed to come to our country for medical treatment, that his life was in danger . . . there was no hesitation on my part," Carter recalled. "I don't recall any tortured decision process."

Once the American hostages were seized, growing out of Iranian protests about the presence of the shah in the United States, Carter faced a series of difficult choices.

"I've thought about it a lot. It was one of the more significant events of my life. And I still don't see a better series of decisions, even in retrospect, that I could have taken than the ones I did take at the time.

"I think it came out well in the end. Our nation's integrity was honored. Its interests were protected. The hostages' lives were spared. Their freedom was restored. I suffered politically, which is not of great moment in the historic scope of things.

"The lesson to be learned is how badly the Iranians suffered. I doubt if any kidnapers ever paid a more horrible price than the Iranians did." Carter said the reaction to the hostage-taking subverted the Iranian revolution, destroyed Iranian prosperity, isolated Iran in the world and probably precipitated the attack by Iraq last fall.

"I think it is recognized that Iran made a terrible mistake and paid a terrible price," Carter said.