Thousands of survivors of the Holocaust gathered last night to honor the dead, give thanks to America and applaud President Reagan when he pledged that "the security of your safe havens, here and in Israel, will never be compromised."

During a somber and emotional evening, the cavernous Capital Centre, usually the scene of sports and entertainment spectaculars, became more like a house of worship as six candles--symbolizing the six million Jews killed as part of Adolf Hitler's "Final Solution"--shone in the dark hall, and the members of the audience, many of them weeping, chanted the Kaddish, the traditional Jewish prayer for the dead.

More than 15,000 people filled the arena in an unprecedented commemoration in this country of the Holocaust and its victims. The occasion was the opening assembly of the American Gathering of Jewish Holocaust Survivors, a four-day observance that has brought to Washington more than 10,000 Holocaust survivors, the largest gathering of its kind ever held.

Many of the well-dressed, middle-aged people in the audience had come from a day of emotional reunions with old friends during the gathering's events at the Washington Convention Center when Reagan, accompanied by First Lady Nancy Reagan, made a brief address to open the evening.

Reagan's speech was punctuated throughout by applause from his listeners, who filled the Landover arena almost to capacity. The other remark that brought heavy applause from the audience was when he made an indirect challenge to the Soviet Union in mentioning Swedish diplomat Raoul Wallenberg, who saved many Jews during the war and is believed by many to be alive somewhere in a Soviet prison.

"I would affirm as president of the United States and if you would permit me, in the names of the survivors, that if those who took him from Budapest would win our trust, let them start by giving us an accounting of Raoul Wallenberg."

Reagan was presented with a scroll signed by more than 15,000 survivors thanking the U.S. armed forces who fought the Nazis and liberated thousands of Jews from Hitler's death camps. He and Mrs. Reagan then departed to the strains of "Exodus" played by the U.S. Navy Band.

This thanks also was expressed by Benjamin Meed, the principal organizer of the gathering. "We have assembled here in our nation's capital--the world's greatest democracy--to give thanks to those hundreds of thousands who gave their lives to crush Hitler's Germany. We came to pay tribute to them and to thank you America."

One of the themes of the gathering, besides the commemoration of the American government's efforts on behalf of Jews during and after World War II, is that mankind must be on constant guard to prevent another Holocaust.

Meed, a former resident of the Warsaw ghetto whose brave but futile uprising against their Nazi occupiers took place 40 years ago April 19, said the purpose of the gathering was to "keep the memory alive--and to warn the world again and again--don't let this happen again."

Elie Wiesel, the Jewish writer, also spoke of the need to guard against conditions that would lead to persecutions. "We don't want pity, rather we want understanding, awareness. We want people to know that since this happened once, it must not happen again to anyone . . . . We don't forget that once the killers began killing Jews they began killing others."

Early in his speech Wiesel made an appeal to the friends of Israel to support that country and in what many took to be a pointed reference to the recent pressures from Washington on Israel, he said that the tiny country was unique because it was "threatened militarily by its enemies and politically by its friends."

Although the organizers have downplayed the political aspects of the gathering, Meed also said that one of the purposes of the assembly was also "to express our close ties to the state of Israel."

Reagan told the survivors that "as a man whose heart is with you--and as president of a people you are now so much a part of--I promise you that the security of your safe havens, here and in Israel, will never be compromised.

"Our most sacred task now is insuring that the memory of this greatest of human tragedies, the Holocaust, never fades . . . . "

The observance, the president said, was also a means of recognizing those--some of them called "righteous Gentiles"--whose moral fiber held firm during the days of the Holocaust, and sheltered and saved Jews.

Their moral character and consciousness must be fostered, he said, and Americans must recognize that for freedom to endure it must be made innate so that "when confronted with fundamental choices we will do what is right, because that is our way."

Earlier yesterday, participants in the observance arrived at the Washington Convention Center for registration, and many of them, like Jando Weis, a carpenter from Cherry Hill, N.J., began searching for some scrap of information about relatives who were killed.

"I cannot give it up, " said Weis, 61. "This is the last hurrah. I'm not young any more."

On the breast pocket of his tweed jacket was a bright yellow cloth star. When he wore such a star nearly 40 years ago as a youth of 18 in his Hungarian village of Mukacevo, it was a dire warning that as a Jew he was in for serious trouble from the spreading Nazi occupation of Europe.

Yesterday he said he wore it "for remembrance." Weis lost all of his immediate family in World War II.

A bank of computers was being used to try to match survivors with old friends and relatives, some of whom had not seen each other for 30 years or more.

The scene around the computers was hectic, but Hadassah Rosensaft of New York had not even used the computer before getting what she described as "a shock." Rosensaft, who was born in Sosnowiec, Poland, survived the death camps of Auschwitz and Bergen-Belsen. Yesterday morning she had just finished saying that "in each of us lives a spark of hope that maybe I will find a lost relative," when a woman went up to her.

"Do you remember my face?" the woman asked. Rosensaft hesitated. The woman described her background. She was the granddaughter of a rabbi who was the uncle of Rosensaft's mother. Then Rosensaft remembered.

They were relatives, distant relatives. But they were both survivors of the Holocaust, and Rosensaft called the unexpected meeting "very moving."

Today, Rosensaft and her relative, Bronia Schwartz, plan to meet and to talk for a long time.