President Carter called today for a broadening of American foreign policy beyond narrow alliances rooted in anti-communism to embrace the thirst for social justice in "a politically awakening world."

Speaking at the 132d commencement exercises at the University of Notre Dame, the President also issued a warning to Israel that American policy in the Middle East will not change with a change in the Isreali government. The United States, he said, expects the new Israeli government to remain bound by the terms of U.N. Resolution 242, which pledges as part of a peace settlement, the return of territories captured by Israel in the 1967 war.

The issue is particularly sensistive in the wake of the victory of the conservative Likud Party in last week's Israeli national election. Since the election, Likud's leader, Menachem Begin, has made it a point to visit Israeli settlements on the West Bank of the Jordan River, calling them "liberated territories," not "occupied territories."

Begin repeated that characterization today in a televised interview. He said he would "not under any circumstances" consider the return of those territories or the creation of a Palestinian state.

En route to South Bend, a White House official who asked not to be identified said Carter's remarks could be interpreted as a sign to Begin to ease his stance on giving up any captured territory. But the official later backed down on that assessment, noting that Begin has not yet formed a new government.

Beyond the brief mention of Israel, the main thrust of the President's speech dealt with what he said were changes in the structure of world power that demand "a new American foreign policy - a policy based on constant decency in its values and on optimism in its historical vision."

"We can no longer have a policy solely for the industrial nations as the foundation of global stability, but must respond to the new reality of a politically awakening world," he continued. "We can no longer expect that the other 150 nations will follow the dictates of the powerful, but we must continue - confidently - our efforts to inspire and to persuade and to lead."

The speech was broad in nature and philosophical in tone.Its underlying theme was that, having survived the mistakes that led to Vietnam, the United States should be confident enough to forge a broader foreign policy, rooted first in a concern for human rights.

But Carter also used the occasion to make some pointed observations about two of the most sensitive areas of foreign relations, Israel's attitude toward captured territories in the Mideast and the situation in southern Africa.

On southern Africa, the subject of inconclusive talks last week between Vice President Mondale and South African Prime Minister John Vorster, Carter stressed the need for speed in bringing about black majority rule in that part of the world.

"To be peaceful," he said, "change must come promptly."

The President arrived here early this afternoon for his third appearance on the Notre Dame campus in little more than a year. White House officials said it resulted from a personal invitation from the Rev. Theodore M. Hesburgh, Notre Dame's president.

It also did not seem surprising that Carter, who was thought to suffer from a weakness among Catholic voters in the election, would choose the nation's best-known Roman Catholic institution as the site of his firstscommencement address as President.

Dressed in a traditional black academic robe and holding the purple-and-gold hood representing the honorary Doctor of Laws degree he received, Carter entered the cavernous Notre Dame Athletic and Convocation Center at the end of a long academic procession. He was greeted with a ripple of applause that grew in intensity as more of the 13,000 people in the center - including 2,177 graduates - spotted him.

The citation that accompanied his honorary degree praised Carter for "offering a generous amnesty to those caught in the misadventure of Vietnam" for using foreign aid" as a leverage to improve conditions of human dignity," for warning Americans they must alter "a wasteful lifestyle" and for his strategic arms limitation proposals to the Soviet Union. Each of these items provoked applause from the audience, with the strongest applause for the Vietnam amnesty.

While the President's speech touched on a number of specific aspects of administration foreign policy, White House officials said its basic purpose was to lay out Carter's "vision of America's position in a changing world."

The United States, the President said, should not fear changes in its role in the world but should accept them with "a quiet confidence in our own political system."

"Being confident of our own future, we are now free of that inordinate fear of communism which once led us to embrace any dictator who joined us in our fear . . . ," he said.

"We fought fire with fire, never thinking that fire is better fought with water. This approach failed - with Vietnam the best example of its intellectual and moral poverty."

Tracing the development of American foreign policy since World War II, the President said that policy has been based on two principles - containment of the Soviet Union and "the importance of an almost exclusive alliance among non-communist nations on both sides of the Atlantic."

Such an approach, Carter said, no longer is sifficient.

But while the President stressed that U.S. foreign policy must look beyond existing alliances with other Western democracies, he also said, in outlining the "five cardinal premises" of his approach to foreign policy, that those alliances must continue and be strengthened, as must the more recent efforts to reach accommodations with the Soviet Union and China.

Three other premises, he said, are to aid the developing nations, to encourage all nations to rise above "narrow national interests" and - first and foremost - to "reflect our people's basic commitment to promote the cause of human rights."

However, while Carter's speech was sprinkled with references to his stand on human rights, he took care to note, as he has on other occasions recently, that he is not naive about the issue.

"This does not mean that we conduct our foreign policy by rigid moral maxims," he said.

"I understand fully the limits of moral suasion. I have no illusion that changes will come easily or soon. But I also believe that it is a mistake to undervalue the power of words and the ideas that words embody."

The President, who returned to Washington last night, was accompanied here by House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.), who received on honorary Doctor of Laws degree, and former Senate Majority Leader Mike Mansfield. Mansfield, Carter's choice as ambassador to Japan, was awarded Notre Dame's highest honor, the Laetare medal, awarded to a Catholic for "distinguished service" to his or her country.

Federal Reserve Board Chairman Arthur F. Burns also was awarded an honorary Doctor of Laws degree.