Shah Mohammad Reza Pahlavi indicated yesterday that he might be willing to impose an oil embargo on Israel as part of overall international sanctions to persuade the Jewish state to be more flexible in negotiations with Egypt.

His first hint that he might alter his longstanding policy of not mixing oil with politics, however, was so hedged with conditions as to appear no more than a warning to the Israelis, with whom he has maintained close, if quiet, relations over the years, including supplying them with oil.

At several points in a nearly hour-long interview the shah illustrated his growing coolness towards Israel and concern about Egyptian President Anwar Sadat's floundering peace initiative.

"The Israelis are much too stubborn, more than what security requires," the shah said. "The only way" for a breakthrough, he added, was American pressure on Israel, he said. "There is no other way."

Running throughout his remarks was a seeming sense of depression at what he considered directionless American foreign policy which, in part, was used to justify present negotiations with West German and Dutch companies for "maybe a dozen" frigates and a "few more" submarines. They would be assigned to bolster Iranian naval forces in the strategic Indian Ocean and Persian Gulf.

Declaring that Iran was "very far" from completing its already massive arms purchases, the shah said the negotiations go beyond the six submarines Iran recently ordered from West Germany. He said he hoped to purchase the firgates at a cost of between $130 million and $140 million each.

Discussing the Tabriz riots of two weeks ago, the greatest challenge to his authority in 15 years, the shah indicated willingness to tolerate leftist and rightist opposition that he blamed for the trouble.

"I am not going to change my policy of liberalizing to the maximum we can," he said.

He made it clear, however, that his own brand of liberalization had definite limits, insisting that the fledgling dissident movement was "completely illegal" and warning, "obviously, we will not let it get out of hand."

On the Israeli oil supply question, the shah was asked if he was prepared to reduce deliveries to make the Israelis less intransigent in the current peace efforts.

"That depends," he said. "If there is a general decision by all, for instance, America, to stop your delivery of arms, that kind of embargo, you know, then everything is possible."

He added that another example would be "embargoes on everything such as has been decided against Rhodesia and South Africa" by the United Nations.

He stressed, however, that "It is not in my hands anyway. It must be a general policy" agreed by the United States and United Nations.

Despite the dollar's dramatic fall, which he termed "the problem of the hour," the shah said he would honor his pledge to freeze oil prices throughout 1978. He said Iran was hurting "a little less" than other producers because we spend so much money in the United States."

Regarding the troubled horn of Africa, he hinted that Iran was supplying Somalia with military equipment of non-American manufacture, which, he said, was "our own business."

Asked specifically what Iran was doing to make good his New Year's Day pledge "not to remain indifferent" is Somalia proper were invaded by Soviet-backed Ethiopian troops, he said, "Obviously we cannot say these things publicly."

Questions about American policy in the Horn of Africa elicited a series of pessimistic remarks about America's world role since what he called "the trauma of Vietnam and Watergate."

"You have no policy anywhere," he said. "You only react when something happens. The other sid is planning something for 50 years."

"If the West wants to die slowly that is your business," he said at another point in the interview conducted at the Niavaran winter palace in northern Tehran. He spoke of an American temptation to "live in your dream world" and said a desire to retreat into a "Fortress America" was a mistake.

"There will be no such thing as Fortress America," he said.

Despite these strictures, the shah was apparently pleased with the state of his relations with the Carter administration.

"Between governments we've never had it so good," he said.

He initially praised the American role in the Egyptian-Israeli negotiations where "you are trying very hard to be of some of positive assistance."

As for his domestic political problems with the dissidents, the shah sought to portray them as a nuisance rather than a direct threat to his rule.

"If I have to defend my country I could be the toughest guy," he said, "but when it is not necessary why should I be?

"I think we are strong enough, the basis of our society and state is strong enough to allow at least to this limit and even more."

He shrugged aside suggestions that President Carter's espousal of human rights had played a role in encouraging dissidence in Iran and subsequent distrubances.

"Yes, you can say that this (violence) is related completely to this liberalization program," he said, "but this is the price we have got to pay."

He described the main dissident groups -- a writers' association, a jurists' association and a committee for the defense of human rights -- as "completely illegal."

"We don't mind," he said. "They can talk as much as they want."

He accused them of being followers of the late Prime Minister Mohammed Mossadegh, the ultranationalist who, with Communist backing, briefly overthrew the shah in 1953 before he was put back on the throne by a CIA-backed coup.

Asked about the chances of accepting the dissidents' requests for basic liberties -- such as freedom of the press and assembly -- the shah insisted that press freedom exists here. By most accepted international standards, however, it does not, and the censored press has refused to print the dissidents' letters.

As for the right of assembly, "They do what they want," the shah said, insisting that when the dissidents were in power they had restored to martial law and the gallows.

He appeared careful to avoid accusing en bloc the powerful temporal leaders of the conservative Shi'ite sect of Islam, which is Iran's state religion.

Although they are the main force in the opposition -- and showed their muscle in Tabriz -- the shah said, "We cannot put them all in one basket, we cannot say all are that kind, just a few."

"We are not babies, we know what contacts they have with all the foreign correspondents here," he said.

"We know when they go to Qom," a holy city south of Tehran and site of a demonstration in which police fired on a crowd in January. "We know they try to excite the clergy. We know that, too, these precise things. You see they are free."

The shah said that has jails held about 2,200 political prisoners whom he called "terrorists." He indicated that more would be released, a process which began last year.

He took exception to criticism that prisoners were being asked to "say they are sorry or ask for amnesty" to win release.

"If this is mental torture," he said, "then what can we do?"

Explaining his decision to fire three top officials in Tabriz for negligence, he said outsiders sometimes complained that SAVAK, the acronym for the secret police, was more efficient or worse than its Soviet counterpart, the KGB. But he made it clear that SAVAK had failed to uncover plans for the demonstrations which degenerated into a violent rampage in Tabriz.