On the eve of a parliamentary vote of confidence, premier-designate Shahpour Bakhtiar today grappled with continued domestic unrest and the growing possibility of an imminent return to Iran of the exiled religious leader Ayatollah Ruhollah Khomeini.

Antigovernment mobs in the southern city of Shiraz attacked the local headquarters of the secret police, SAVAK, for the second day running, sorely testing the authority of both the Bakhtiar government and Iran's religious opposition leaders.

Reports circulating here that Khomeini plans to return shortly from Paris to Iran presented the potentially most serious challenge to the survival of Bakhtiar's Cabinet.

The reported decision reflects the ayatollah's concern that mounting radicalization of the Iranian opposition is undermining his authority, political observers said.The return would also set up a showdown between Khomeini and Bakhtiar that could force the new government to fall back on the military, which Bakhtiar has been anxious to tame.

Reports quoting Khomeini's associates today said the 78-year-old Shiite Moslem leader intends to return to Iran as soon as Shah Mohammad Reza Pahlavi leaves, and that the Bakhtiar government would be "swept aside." Any attempt by the army to stand in Khomeini's way would be useless, the associate reportedly said, because the troops would follow the ayatollah.

Previously Khomeini had said he would not return until the shah's monarchy was overthrown, a condition that would not appear to be met by current plans for the shah to leave the country "temporarily" in favor of a regency council to permit Bakhtiar to restore order.

Bakhtiar told reporters the regency council would be formed in the next two days. Political observers took the statement as another sign that the process of arranging the shah's departure is continuing, although the Imperial Palace has not yet said when or where he is going.

In Shiraz, a picturesque city near the ancient ruin of Persepolis in southern Iran, Moslem leaders appealed for calm after clashes Thursday in which at least three SAVAK agents and three demonstrators were reported killed.

Witnesses said thousands of protesters took to the streets two days after the new government ordered the lifting of martial law in the city as the first step of a plan to restore civilian administration gradually throughout the country.

The mob set huge bonfires at several squares, pulled down statues of the shah and burned the local SAVAK offices, the witnesses said. A hotel was also reported slightly damaged.

In a statement broadcast on national radio, the city's religious leaders asked the populace "to promote Islamic objectives and cease any kind of destruction or harm to people."

Another broadcast statement by Bakhtiar warned that "anyone disturbing the peace will be dealt with harshly."

Despite the appeals, however, mobs set fire to the SAVAK building again today. No troops or police intervened to stop them, residents said.

The failure of many Iranians to heed orders from Khomeini himself to stop revenge killings of soldiers and policemen in several cities and to start raising oil production has aroused fear among the Moslem clergy that the situation may be getting dangerously out of hand.

The need to reassert control is considered the main factor influencing Khomeini's reported decision to hasten his return to his native land, from which the shah exiled him 16 years ago.

In Tehran, representatives of the government and the shah pressed ahead with efforts to form a regency council, which is to represent the monarchy while the shah is away for what is officially described as a "holiday."

According to Iran's 1906 constitution, a regency council should include the prime minister, the two speakers of parliament, the chief of the supreme court and four other respected figures.

Government sources said one of the four would be the elderly minister of the imperial court, Ali Qoli Aradalan. They said others could be drawn from the military, the political opposition, or, possibly, the Shiite Moslem clergy that has been in the forefront of the movement against the shah.

Insiders also confirmed that the Iranian ambassador to Washington, Ardeshir Zahedi, plans to leave the country and return to his post within a couple of days -- a move seen as heralding the shah's departure and facilitating Bakhtiar's efforts to consolidate his hold on power.

Bakhtiar faces parliamentary debate over a vote of confidence in his government over the weekend, and he is expected to be confirmed as prime minister early next week. Western diplomats anticipate that the shah will leave after Bakhtiar is formally installed.

However, this series of events could lead to a major confrontation if Khomeini makes good his reported intention to return after the shah's departure, political observers said.

Although Tehran has been relatively calm in recent days, there is a possibility of major new protest activity during a planned attempt by teachers and students to reopen universities this weekend.

One hopeful sign that some sectors of the battered economy may return to normal as the shah prepares to leave, however, came as striking bank employes and customs officials announced they would return to work starting Saturday, under certain conditions.

The bank employes, most of whom have been on strike for two months, said they would work three days a week but would boycott any foreign exchange dealings with Israel and South Africa.

A statement by the customs officials said they would clear food, medicine and other essential imports, but no goods brought in by the diplomatic missions of the United States, Britian, Israel or any other countries considered unsympathetic to Iran's "revolutionary movement."