Saudi King Khalif madea strong call today for a return to Islamic fundamentalism with a loyalty "neither to an Eastern Bloc nor a Western Bloc" as 37 Moslem presidents, kings and sheiks and other representatives opened the Islamic world's third and largest summit conference.

Dressed mostly in the simple white robes of the pilgrim and sitting crosslegged under the vaulting colonnade of the Grand Mosque in Mecca, the Moslem leaders listened quietly as Khalid spoke of an "awakening" under way in the Islamic world that he said "is founded upon the recognition of the bankruptcy of imported ideologies and doctrines."

Islamic solidarity, he said, must be used as an "impregnable fortress" to check the struggle of the superpowers seeking to "dominate the destinies of smaller nations and capture their wealth."

"Our loyalties must be neither to an Eastern Bloc nor to a Western Bloc," he continued. "The security of the Islamic nation will not be assured by joining a military alliance nor by taking refuge under the umbrella of a superpower but by our trust in God, our self-confidence and by a tightly woven unity."

Walking with a cane, Khalid, 64, had most of his speech read for him by Crown Prince Fahd, who handles most of the day-to-day operations of Saudi Arabia. The speech seemed to reflect more the official nonaligned stance of the conference as a whole than a shift in the generally pro-Western line of Saudi foreign policy. Moreover, it contained a sharp denunciation of the Soviet invasion of Afghanistan.

Also present for the opening of the three-day summit conference was Palestine Liberation Organization leader Yasser Arafat. But President Elias Sarkis of Lebanon, the only Christian leader of an Islamic Conferene Organization member state, had to remain in Taif for the summit opening because of the ban on nontate, had to remain in Taif for the summit opening because of the ban on non-Moslems in Mecca.

With 38 Arab, African and Asian leaders or their representatives here, including 29 heads of state or government, it is the largest gathering ever of the conference, whose main concerns since its founding in 1969 have been the return of Jerusalem to Moslem control and the liberation of Israeli-occupied Arab land.

A new focus of the conference is Afghanistan. Today Khalid mentioned "the imperialistic invasion of Moslem Afghanistan by the armed forces of the Soviet Union" in the same sentence as occuped Jerusalem and Palestine and called them the three principal "oppressive conditions" facing the Moslem world.

Saudi hopes for a reconciliation here between warring Iran and Iraq were dashed by the refusal of Iran to attend because of the presence of Iraqi President Saddam Hussein.

Khalid made no direct mention of the war but seemed to have it in mind when he said the strength of the Islamic world could only be ensured "by renouncing and resolving discords and disagreements in a spirit of Islamic love and fraternity, mutual respect and noninterference in the affairs of others."

Khalid appealed to the Moslem world to overcome its divisions by rejecting what he called attempts of the United States and Soviet Union to expand their military and political presence in this region.

Among his listeners were Syrian President Hafez Assad, who signed a 20-year friendship treaty with Moscow last fall; President Ali Nasir Mohammed Hasani of South Yemen, where the Soviets have land and naval facilities, as well as Somali President Mohammed Siad Barre and Sultan Qaboos bin Said of Oman, both of whom signed agreements last year giving U.S. forces access to their ports and airfields.

Even Saudi Arabia last fall called on Washington to send four early-warning radar planes to help protect this country from possible Iranian attacks.

Khalid also struck out against the resort to foreign policy, calling upon all Moslem nations to establish Islamic law as the foundation of their societies and suggesting that a conference of lawyers be held to find "a correct and genuine Islamic answer to all questions raised by the challenges of contemporary life."

This appeared to be an indirect attack on not only the Marxist ideology of South Yemen but also on the secular Arab socialism of the Baath Party that is in power in Syria and Iraq.

One purpose of opening the conference in Mecca, conference sources said, was to show Moslem leaders that all the damage done to the mosque when it was seized by Islamic fanatics in November 1979 has been repaired and that all is well.

Among these repairs was a new marble floor put in around the Kaaba, the revered stone monument in the center of the mosque that dates from the time of Abraham. The old one was badly damaged in the fighting that took place inside the mosque. The incident shocked the Moslem world because it is strictly forbidden to carry arms or commit a hostile act inside the mosque.