President Anwar Sadat today dismissed out of hand American concern that his embrace of Iran's fallen shah could complicate efforts to free American hostages at the occupied U.S. Embassy in Tehran.

"Put the question to President Carter," he told reporters who asked about increased confusion in Tehran because of the shah's arrival here yesterday for asylum. "For me, I have no problem."

Sadat's comment, made after a quarter-hour visit to the shah's sickbed, underscored his determination to show hospitality and gratitude to the former monarch whatever the consequences in Egypt, the Arab world and elsewhere.

He seemed to go out of his way to confront those who have criticized his gesture -- particularly in Iran -- much as he regularly has been swinging back at Arab critics of his peace treaty with Israel. In language calculated to inspire further anger in Tehran, he charged that Ayatollah Ruhollah Khomeini's religious leadership in Iran "is not true Islam."

"Let me tell the people in Iran that their shouts will never bother us," he said. "We have accepted the shah is true Moslems, not [like] the Islam they preach there."

Sadat's comments appeared to be at variance with U.S. advice reportedly relayed through Ambassador Alfred Atherton that he prevent the shah's presence here from becoming another subject of dispute between Egypt and its critics.Similarly, Sadat has in the past ignored advice from the United States and his own Foreign Ministry in making truculent statements about Arab opponents of his peace policies, particularly Saudi Arabia.

Egyptian sources said this attitude flows from an unshakable conviction that he is steering Egypt on the best course and that even his strongest critics eventually will realize that his decision to make peace with Israel, and now to welcome the shah, were the right things to do.

As if to illustrate the assessment, Sadat said today that the shah has accepted his offer to reside permanently in Egypt and that if he tried to refuse, "I shall force it on him."

Egytian newspapers reported that a Cairo palace that formerly belonged to Egypt's royal family is being readied for the shah's relatives. His wife, Farah, arrived with the shah in a chartered DC8 yesterday along with a half-dozen aides. Other members of the family flew in later in another plane, Egytian authorities said.

The shah, who appeared frail and drained on his arrival, remained in his suite of rooms overlooking the Nile on the third floor of the 300-room Military Hospital in the southern Cairo suburb of Maadi.

The hospital director, Sabri Ismail, said the shah is undergoing tests here while doctors also study results of earlier tests in Panana to determine when he can be operated on.

The shah team of American doctors said earlier that he needs surgery to remove his spleen, which they suspect is cancerous. It was during negotiations over where the operation should take place that the shah, reportedly dismayed by the discussions and fearful that his life was in danger, suddenly flew from Panama to Egypt despite U.S. advice that he remain.

Musa Sabri, editor of the government-controlled Al Akhbar newspaper, wrote today that the shah had heard of a CIA plot to have him killed. Whether true or not, Sabri wrote, the shah entertained the idea and this was an illustration of how much he distrusted the Americans and Panamanians negotiating over his future.

Sadat said today the Shah is suffering from a fever, but otherwise is doing as well as can be expected. American doctors, including the previous team headed by Dr. Michael DeBakey of Houston, are free to come to Cairo to continue their treatment if the shah wants them, he said. In the meantime, he added, the former Iranian monarch is in the care of "my capable Egyptian doctors."

Sadat has named a 15-man medical team to look after the shah. According to Egyptian and Western experts, the Egyptian doctors are fully capable of performing the spleenectomy required by the shah, even given his tenuous health. Such operations are performed routinely at the military hospital, they said.

Removal of the spleen is a particularly well-known operation in Egypt because schistosomiasic, or bilharzia, is a common disease along the Nile and often results in enlarged spleens.

Besides the added complications in Iran referred to today by Iranian Foreign Minister Sadegh Ghotbzadeh, American officials are said to fear that Sadat's show of hospitality for the shah could also make the Palestinian autonomy negotiations with Israel more difficult.

Arab leaders, even those who abhor the chaos of revolutionary Iran, must be conscious of the Islamic fundamentalist current sweeping across the Middle East with Khomeini's Koran-based leadership as its inspirations. Sadat's solidarity with the shah thus isolates him further from the Arab world that also is shunning the peace negotiations.

In addition, the shah was regarded with distaste in most of the Arab world. His policies of cooperation with Israel were widely criticized and his pretentions to regional leadership revived historical strains among Persians and Arabs.

Sadat also has his own critics at home who oppose his kindness to the shah. Al Chaab, organ of the opposition Social Labor Party, charged today that Sadat is "protecting him against the will of his people."

There still was no word, however, from the Moslem Brotherhood or any of the other rightist Moslem groups that attacked Sadat's earlier invitations to the shah on grounds of support for the Islamic revolution in Iran. Most observers here believe that the conservative rightist pose the only real threat of popular opposition to Sadat.