Full of pain, Cantor Joseph Malovany's voice rose clear and plaintive through the Capitol Rotunda. He grimaced sometimes as he sang, the words of the "El Moleh Rachamim" almost a wail, overpowering the silent group that assembled to remember the Holocaust yesterday. It is a Jewish prayer, the title of which means "Oh, Lord, who art full of compassion."

Author Elie Wiesel, a survivor of the Holocaust, soberly shook his head. As the cant continued, he closed his eyes and buried his head in his hands.

"Let us remember that what Nazism did to its Jewish victims was considered legal," Wiesel, president of the U.S. Holocaust Memorial Council, said during his remarks. "It was legal to imprison political adversaries . . . it was legal--and commendable--to push Jews into ghettos, to torment them, to torture them, to gas them, to burn them . . . Remember that it can be done--for they did it. The law itself became immoral. Inhuman."

The ceremony, attended by members of Congress and seven survivors among others, marked the beginning of Yom Hashoah, the Day of Remembrance of the Holocaust. The commemoration began yesterday, the 39th anniversary of the uprising of the Jews in the Warsaw Ghetto. For the ceremony, the Atlanta Boy Choir, all in yarmulkes, sang for the ceremony, and the survivors lit candles. Wiesel, House Speaker Thomas P. (Tip) O'Neill, Sen. Ted Stevens (R-Alaska) and survivor Sigmund Strochlitz all spoke of the horror of the Holocaust and the importance of remembering it.

"We have an obsession," said Mark Talisman, vice chairman of the Holocaust Memorial Council, "not to betray the dead . . . they were killed once. They must not be killed again out of forgetfulness."

An hour later, in the East Room of the White House, President Reagan paid tribute to the Holocaust victims. "Today, perhaps for a moment, we should think of those who are not with us," he said. "We miss these people, though we were never permitted to know them. God understands how different, I'm sure--and only God--our lives would be had they been permitted to live."

Echoing a reference Wiesel had made to nuclear proliferation, Reagan said, "Let us also bear in mind on this special day that the entire human family now faces the threat of a different kind of holocaust--a nuclear holocaust. May the remembrance of past victims of man's inhumanity to man strengthen our resolve to seek a just and peaceful world for ourselves and our posterity."

Reagan called Israel's imminent return of the Sinai "a magnificent act of faith by Israel for the sake of peace . . . The United States is grateful for their step which reinforces our firm commitment to Israel's security. Today we're reminded that we must be sensitive to the history of a people whose country was reborn from the ashes of the Holocaust--a country that rightfully never takes its security or its survival for granted."