n an unusual attack on Western media coverage of his crackdown on religious extremists and political opponents, President Anwar Sadat angrily asserted today that there was no parallel between events unfolding here and those that led to the fall of the late shah of Iran.

"Do not fear that we shall be having a Ayatollah Ruhollah Khomeini here," he told a press conference of foreign correspondents at his residence in this small village 45 miles north of Cairo.

Khomeini, Iran's spiritual leader, today attacked Sadat over his crackdown, Reuter reported. In an address to Iranian Moslem leaders, broadcast on Tehran radio, Khomeini charged that Sadat had "taken control of the mosques and banned the clergy from participating in politics."

Apparently referring to both Iran and Egypt, Khomeini said participation in politics was at the forefront of the teachings of Mohammed.

Sadat spoke out sharply against commentary in the American press suggesting that Egypt had become "unstable and unreliable" and himself the "shah number two." He said there was no comparison between what was happening here and what occurred two years ago in Iran, saying "I shall never permit this because this is not my people, the Egyptian tradition or the Egyptian conduct."

Seeking to reassure his supporters in Western Europe and particularly in the United States, Sadat nonetheless admitted during a 90-minute attack against the Western media that Moslem "fanaticism," together with Christian extremism, had become a serious problem.

"But let me tell you this in all confidence," he said referring specifically to the fundamentalist Moslem Brotherhood, "the regime has nothing to fear from them."

"How can they think of any revolution with a powerful government like my government, a powerful administration and a powerful institution? . . . No, I didn't do this crackdown because I felt there was any danger against the regime. On the contrary."

Sadat said that despite the arrest of more than 1,500 Moslem and Christian extremists, politicians, journalists and lawyers accused of fomenting sectarian strife, democracy was still "flourishing" in Egypt and he has no intention of banning the present opposition parties.

"Opposition is a main fact in democracy, and democracy would not be real without opposition and without a multiparty system," he remarked. But he did disclose he was drawing up a new "charter" to regulate political activity.

He said Egypt was still "an island of stability in a very troubled area."

He said he was defending the interests of "99.9 percent" of his people in cracking down on the sectarian strife afflicting the country and on his opponents who were "distorting the image of Egypt" abroad. He predicted confidently that Thursday's referendum on the stiff measures he announced Saturday to bring an end to the strife would reflect this support.

The measures include the abolition of seven religious or political opposition publications; the disestablishment of Pope Shenuda III, patriarch of the 5 million Egyptian Christian Copts; the dissolution of 13 religious groups, and a trial for all detainees on charges of undermining social peace and national unity.

Sadat flew into a veritable rage when asked a question by Paul Miller, correspondent of NBC, about whether he had discussed the steps he took this past week with President Reagan during his visit to Washington in early August to get his prior approval.

"You have no right at all to ask such a question like this because no one takes decisions here except me -- through my institutions," he snapped.

Sadat said that since the revolution, led by officers including Sadat, which overthrew the monarchy in July 1952 "no power has any decision here, neither the British nor the Americans."

The 61-year-old Egyptian leader said that Egypt had experienced "more than 15 years of confrontation" with the United States in the past over American attempts to interfere here and that he himself had ordered 17,000 Soviet experts to leave in one week when he had a "shade of a doubt" about what Moscow was up to in the country.

Today, he said, Egypt stood ready to work "hand in hand" with the United States and felt enormously indebted to Washington for the massive economic aid and political support it had lent his country over the past seven years.

Sadat indicated again and again that he was outraged and bewildered by the increasingly negative Western press and television coverage of his regime, particularly the comparisons being drawn between himself and the shah.

He attacked by name David Hurst, a Beirut-based British correspondent for The Manchester Guardian and Observer of London; William Safire, a columnist for The New York Times; the ABC television network, and NBC's Miller, after he posed his question at the conference.

The Egyptian leader blamed in particular Hurst and the well-known Egyptian journalist, Mohamed Haikal, for much of his bad press. Haikal is among those arrested.

Sadat continued his running feud with ABC television, which he accused in July of preparing a program, timed to his trip to the United States, in which he was allegedly compared to the shah of Iran. He said that after he had complained about that program, which was never shown, ABC had done another one which included an interview with Hurst, making the same comparison between himself and the shah.

The extent of Sadat's pique with the foreign press, particularly the U.S. media, was made clear today during the conference.

After Miller asked if Reagan had been informed and approved of his crackdown, Sadat replied, "I am sorry it is a democracy, or I could have taken precautions against you."

At the end of the press conference, he remarked jokingly, "In other times, I would have shot him, really, but it is democracy I am suffering from as much as I am suffering from the opposition."