Army insubordination was reported during a demonstration against the shah in the northwestern city of Tabriz today while a general strike shut down most shops and many offices in Tehran.

There were conflicting versions of the Tabriz incident. Opposition sources claimed that a unit mutinied and joined protesters against the shah during their march, but a government official said only that some soldiers refused to obey orders and were withdrawn to their barracks.

The opposition officials also said some troops turned their weapons over to local clergymen during a demonstration in the holy city of Qom, 10 miles south to Tehran, but there was no independent confirmation of the report.

Any refusal by troops to carry out orders against demonstrators marks a grave danger to the military government of Shah Mohammad Reza Pahlavi because the army is the last firm pillar of support for his efforts to restore order and remain in power.

A rebellion on the scale described by the opposition sources would be an even more serious development. The armed forces have been coming under increasing pressure from the influential Shiite Moslem clergy as the Iranian crisis builds.

Ayatollah Ruhollah Khomeini, the exiled clergyman leading the fight against the shah, said in his latest elamieh , or clandestinely distributed statement: "I once again appeal to members of the armed forces to desert their posts and to stand in the ranks of the nation, which is fighting for a just cause, the cause of Islam."

A week ago, during the most important Shiite day of religious mourning, a dozen officers were killed when three disgruntled soldiers from the shah's elite Imperial Guard sprayed their mess hall with automatic weapons fire at a base not far from the imperial palace.

Local military commanders carrying out the government's tough new measures in the oil fields seemed to be forcing workers back to their jobs, however, and production continued to climb. Output was reported at a rate of 2.6 million barrels a day, still less than half normal production this time of year but up from the lows of fewer than a million barrels some days during the politically inspired strike now in its third week.

The Tehran strike closed the capital's bazaar and most stores to mourn the deaths of anitgovernment protests last week. In violation of a back-to-work order by the government employe attendance was reported spotty at ministries and other government-owned concerns. Domestic flights by the national airline were canceled or delayed.

Reports on the Tabriz incident were contradictory. With opposition and government both distorting events to suit their causes, journalists increasingly find it difficult to sift fact from invention on events in the provincies.

The opposition National Front said flatly in a communique that troops took part in the Tabriz demonstrations. But the official Iranian television interrupted its regular program to deny the report after it was broadcast on the Persian-language services of the British Broadcasting Corp. beamed to Iran.

The size of the demonstration at Tabriz was put at anywhere between 20,000 and 200,000, depending on the source.

An Iranian government official said troops had been lining the sides of a street during the procession and that an entire unit was withdrawn to barracks when some soldiers refused to obey orders. He would not specify what the orders were.

"There were some disturbances, but no one joined the crowd," the official said. He conceded that "on the way to the barracks some soldiers showed sympathy" with the protesters. He added there were unconfirmed reports that military vehicles had been "captured" during the demonstration.

Another official source said 25 soldiers participated in the potest.

A spokesman for the opposition National Front said two persons were wounded when troops opened fire on demonstrators. But, then, he said, a Shiite clergyman made an impassioned plea to the soldiers and succeeded in getting many of them to join the crowd.

An opposition member of parliament from Tabriz, Ahmad Bani-Ahmad, told reporters in Tehran constituents told him by telephone 500 soldiers and 12 tanks went over to the protesters' side.

He reported that pictures of the leading opposition religious leaders-Khomeini, who lives in exile outside Paris, and Seyed Kazem Shariat-Madari, who resides in the Iranian holy city of Qom-were taped on the sides of army tanks and trucks, and that the crowds wildly cheered the soldiers who joined them.

A foreign resident of Tabriz, which was the scene of major rioting in February, said a few soldiers did join the protesters but he was unaware of any tanks on the streets of the East Azarbaijan provincial capital. He said, however, that armored personnel carriers have been in evidence.

Azarbaijan broke away from Iran after World War II and tried to set up a separate state under Soviet tutelage. But when Soviet troops were forced to end their occupation of the province under allied pressure, the separatist movement collapsed and the forces of the young shah made a triumphant entry into Tabriz.

In Tehran, up to 10,000 people chanted slogans against the shah during mourning ceremonies at the Behesht Zara Cemetery south of the city. Protestors said one of the graves surrounded by morners belonged to a soldier who took part in the attack on the Imperian Guard officers.

He was indentified as Taghl Habibpour, a draftee who allegedly told his family before the attack that he wanted to avenge the Sept. 8 killing of Iranian demonstrators at Tehran's Jaleh Square and become "a servant of the man," meaning Khomeini.

Another major demonstration was reported in the northeastern city of Mashad.