Gunmen attacked a downtown Tehran police station early today, killing a policeman and wounding two other persons in a raid that security forces feared could signal an upsurge of urban guerrilla activity.

Most of the 11 months of protests against Shah Mohammad Reza Pahlavi so far have taken the form of street demonstrations by unruly but unarmed mobs. Any significant resistance by armed groups would mark a new escalation in Iran's turmoil.

Iraman guerrilla groups are receiving some weapons from abroad and "other elements which didn't have access to guns before" are getting them now, too, one source said in an apparent reference to less organized opponents of the shah.

Most of the arming still appears to be small-scale, however, the fruit of isolated raids on provincial and municipal police posts. But there are increasing signs that some links are developing between organized Iranian opposition groups and Palestinian guerrilla organizations that have vast stores of arms.

As far as Americans in Iran are concerned, the guerrilla group known as the People's Strugglers is deemed the greatest worry. This group, espousing a blurry ideology based on Moslem fanaticism, has in the past specifically targeted U.S. military and civilian personnel. It was held responsible for the August 1976 murders of three American technicians working on a secret defense project in Tehran.

Three homes of Americans were firebombed tonight in north and east Tehran, but there were no reports of injuries, according to U.S. officials. Several American residents also reported written threats pinned to their doors.

Thousands of Tehran residents staged their fourth consecutive night of rooftop chanting in defiance of the government. Occasional rifle shots could be heard in several parts of the city after the 9 p.m. curfew, but the unrest seemed to have abated from the previous three nights.

Most of the noise appeared to come from the bazaar area in teeming south Tehran where residents wailed Moslem chants and shouted, "Death to the shah."

Tehran's martial law administration, installed by the Shah three months ago to crub anti-government demonstrations, said attackers, armed with Soviet-designed AK 47 assault rifles, opened fire on the police station from an overpass they had blocked off from both ends with two cars.

The capital's martial law administrator, Gen. Gholam Ali Oveise, said the gunmen fired 60 to 70 rounds before escaping. The attack occurred in predawn light immediately after the overnight curfew ended.

Officials did not identify the attackers and no group immediately claimed responsibility. Security sources said the assault appeared to be work of a Marxist-oriented urban guerrilla group called the People's Sacrifice Guerrillas, which has become increasingly active lately.

The group claimed responsibility for a similar attack on a riot police headquarters in Tehran two days before martial law was imposed in the capital and 11 provincial cities Sept. 8.

One source said today's attack had "all the trademarks" of earlier operations by the group, which is believed to receive arms and training from the Popular Front for the Liberation of Palestine, a Marxist group based in Beirut.

A Popular Front magazine issued over the weekend in Beirut carried an account of the group's exploits in Iran last month, including the "execution" of a police colonel who allegedly tortured demonstrators in the northeastern city of Mashhad. The account said the guerrilla group carried out antigovernment attacks in three other cities and concluded with a vow to "escalate revolutionary activity for an armed mass struggle."

The same group previously claimed responsibility for the bombing of an American-sponsored academic center in Tehran a year ago shortly before a visit here by President Carter.

But not much had been heard from the group until recently, when the imposition of martial law and later installation of a military-led government seemed to further polarize opposition to the shah and create more favorable conditions for stepped-up guerrilla action, security sources said.

The People's Strugglers have not been very active lately, sources say, but there are indications they may be stepping up training and recruitment. Palestinian Sources in Beirut said Fatah. a more conservative and Moslem-oriented group than the Popular Front, has started training and supplying Iranian guerrillas.

In campus demonstrations before the military government took over last month, student protesters waved banners supporting both guerrilla groups, the first such public show of support in memory.

It is not known whether there are any ties between the Iranian guerrillas and the Shiite Moslem opposition led by Ayatollah Ruhollah Khomeini. But in any case the Palestine Liberation Organization appears to be strengthening its links with both.

Last month a PLO envoy delivered a letter to Khomeini in Paris from guerrilla chief Yasser Arafat and, according to the PLO news agency, "expressed the Palestinian revolution's support for the Iranian people's struggle against the shah."