Prime Minister Shahpour Bakhtiar today outlined in parliament his government's program that effectively dismantles the basis of Shah Mohammad Reza Pahlavi's foreign and domestic policies.

Never once mentioning the shah by name, the 63-year-old prime minister confirmed that his government will not sell oil to Israel and South Africa and promised to abolish SAVAK, the much-feard secret police. He said as prime minister he will support the "legitimate rights" of the Palestinians and in general struck a nonaligned, pro-Islamic stance rather than the militantly pro-Western tilt of the shah.

Indicatie of this was Bakhtiar's declaration that relations with the Arabs "are indesturctible ties woven by history." The shah had emphasized differences between non-Arab Iran and its Arab neighbors in his foreign policy as well as his emphasis on Persian culture.

Foreign Minister Ahmed Mir-Fendereski, speaking separately to journalists, said the future for relations with the West depends on Wsterners' willingness to take into account the revolutionary changes that have taken place here during the last year.

"The ties of friendship and cooperation that exist between Iran and Western European countries will not weaken on condition they grasp the profound sense of the transformation which has taken place in Iran and appreciate it at its proper value," he said. "The same goes for the United States."

That was strong language for a basically pro-Western government still fighting for a confidence vote and not certain to survive rival pressure from the Shiite Moslem leadership on the one hand, or a still possible military coup on the other.

Illustrating how fragile is Bakhtiar's grip on the country was a riot in the southern city of Shiraz. News services said a mob hauled down and burned the American flag in front of the U.S. consulate there and two to eight persons were killed when SAVAK agents opened fire as the mob stormed the hatd police's Shiraz headquarters.

The promise to do away with SAVAK, infamous for use of torture and aritrary imprisonment, was central to Bakhtiar's 20-minute address in the ornate turn-of-the-century majlis, or lower house of parliament. He promised that a special commission will be named to investigate abuses by SAVAK agents.

Only SAVAK's intelligence-gathering funcition will continue, and it will be under different management, Bakhtiar said.

Bakhtiar's program was welcome to most Iranians. But the twin religious and military pressures on his government -- especially in the absence of firm word of the shah's departure -- dampened any enthusiasm he night have been able to stir.

Also inhibiting any popular reaction were riot police with water cannons assigned to deter threatened demonstrations outside parliament. In addition, full debate on the government program will begin only Saturday in the Senate and Sunday in the Majlis.

Until the confinence vote takes place at the end of the debate, the shah has indicated he is not prepared to leave the country.

Bakhtiar's failure to retain as war minister retired Gen. Freydoun Jam also stirred concern. Jam was replaced at the last moment by Gen. Jaafar Shafaqat, the 64-year-old governor-general of East Azerbajian appointd after riots in Tabriz last February that marked the first full-scale show of the religious opposition force. A former Imperial Guard commander, he fired provincial officials in Tabriz for inefficiency and said, "No wonder these people are rioting; they don't have aything -- not even a sewage system."

With the shah's much-delayed departure expected Monday at the earliest, growing radical pressures, combined with Bakhtiar's open government policy, for the first time allowed Ayatollah Ruhollah Khomeini's name to be mentioned on the staterun radio.

An "elamien ," or pamphlet, from the shah's arch-critic living in exile near Paris, was broadcast. Only weeks ago, anyone possessing a copy could have landed in jail.

It ordered Iranians not to attack SAVAK agents and warned extremists against "trying to create panic which might justify a military coup."

In an attempt to keep everyone happy, Bakhtiar in parliamnt was careful to stress the "important element" represented by the army, and also the need for close relations between leaders of the religious and political opposition to the shah.

On domestic questions, he said the special commission also will investigate official corruption, release of remaining political prisoners, provide compensation for families of those who have died in security prisons or been killed in antiShah demonstrations this past year and allow rehabilitation of politicians who had suffered under the shah for the past quarter century.

Martial law will be lifted gradually around the country, free elections assured although no date was fixed, universities freed of restrictive ministerial tutelage and freedom of expression guaranteed, he pledged.

Bakhtiar pledged to fight corruption and inflation and reduce all-pervading government influence except in the nationalized oil and gas sectors.

Speaking about South Africa, Bakhtiar said Iran would look at "overall relations" with Pretoria.

The foreign minister said the Israeli mission here is an "agency which has never been official and only takes care of the interests of Israelis in Iran."

"Its existence does not contradict in any way our will to support fully the Palestinians in their struggle to recover their legitimate rights," he said. Before the current strike in the oil fields, Israel relied on Iranian oil for about 60 percent of its supplies. South Africa obtained as much as 90 percent from Iran.