American feminist Kate Millett was detained today and held at the Tehran airport by Iranian immigration police who said they were going to expel her on the first available flight.

Millett has been active is demonstrations by Iranian women against compulsory wearing of the veil. She has made statements here saying, among other things, that Ayatollah Ruhollah Khomeini, the leader of Iran's Islamic revolution, is a "male chauvinist."

The decision to expel Millett despite potential bad publicity is a sign of the new government's extreme sensitivity on the issue of women's rights. There have been a number of statements in recent days saying Khomeini was misunderstood when he spoke about the veil and that wearing it will not be mandatory under Iran's new rulers.

Westernized Iranian women report that a number of female teachers and office workers have been dismissed for refusing to wear a veil or at least a scarf hiding all their hair. It seems clear, however, that those dismissals were individual initiatives and that the government still is groping for a general policy.

The head of national television has announced that women on screen must hide their hair, but need not wear the veil.

The Millett expulsion action took place as a group of about 20 French women's rights leaders prepared to come to Iran under the sponsorship of Simone de Beauvoir, author of "The Second Sex," a major feminist work published after World War II. It was not clear whether de Beauvoir, who has been having health problems, would make the trip herself.

In the foreign policy field, meanwhile, Iran officially lined itself up with nonaligned nations, a group of mostly Third World countries that profess neutrality between East and West. Deputy Prime Minister Abbas Amir Entezam, the Cabinet spokesman, said Iran has decided to join the nonaligned movement and wishes to attend the next nonaligned conference in Havana, Cuba, in September.

Foreign Minister Karim Sanjaby went to his office for the first time in about a week to meet with the visiting North Korean foreign minister. The meeting was seen as a sign of the importance that the Iranian Revolutionary government attaches to relations with the Communist world and the first clear sign that Sanjaby has indeed, as reported, withdrawn the resignation that he submitted last week to Prime Minister Mehdi Bazargan.

Sanjaby heads the National Front, the leading secular party supporting the Islamic government. It is an open secret in the Tehran diplomatic community that Sanjaby's absence from his ministry, officially attributed to illness, was an expression of unhappiness on several scores.

These include summary trials and executions, which have been halted since Sanjaby first submitted his resignation, and the National Front's increasing anxiety about its political future within this government.

The Front already is under severe challenge from a new party of the center left headed by Hedayat Matine-Daspary, who is married to a granddaughter of the late prime minister Mohammed Mossadegh, the founder of the National Front and the spiritual father of secular opposition to the deposed shah.

There is informed speculation, meanwhile, that the Tehran Revolutionary Court trying former prime minister Amir Abbas Hoveyda, which is presumed to have been the single most embarrassing thing for Sanjaby, came within hours of passing the death sentence and of having it carried out.

The sequence of events has convinced diplomatic observers that the proceeding, which started about 1 a.m. Wednesday morning, was not a pretrial hearing but the real thing. It appeared to follow the pattern of about 60 previous Revolutionary Court trials that ended in immediate executions without defense counsel.

Hoveyda apparently was saved because of two differences in procedure attributable to the fact that the man on trial, the shah's prime minister for 13 years, is the most important figure now in jail. The court agreed to hold more than one session, meaning that Hoveyda was not immediately taken before the firing squad, and a few Iranian journalists attended.

These circumstances permitted Bazargan to learn that the trial was under way and to move to stop it. It was the evening following the first earlymorning court session that Bazargan went on television to denounce the trial as a "disgrace" to the revolution. The next evening he went to see Khomeini at his residence in Qom to argue that the work of the Revolutionary Court must be regularized and brought under control.

At 2 a.m. that same day there was still another execution in Qom itself, and 12 hours later Khomeini issued orders suspending the Hoveyda trial and any executions until the Revolutionary Court could get new guidelines.

Today, spokesman Entezam said that "only" 62 persons have been executed since the revolution, whereas, "if you look at other revolutions in other countries, in the first two or three days, about 400 or 500 people are normally killed."

Entezam said thousands of letters from all over the world have been received pleading for clemency for Hoveyda, including appeals from four former British prime ministers and six French ones. The latter include Edgar Faure, who has said that he wants to come to Tehran to lead Hoveyda's defense.

The French government has announced that it plans to assist Faure in that effort, but Entezam said today Hoveyda's defense lawyer would almost certainly have to be Iranian.