The openness with which the news of President Reagan's cancer was announced surprised the people of many countries where news of a leader's illness is restricted or even kept secret altogether.

Along with expressions of admiration for the president's courage and sympathy for him and his family came comments praising the administration for making public the details of his operation and the doctors' prognosis.

In Manila, where there long has been speculation about the health of President Ferdinand E. Marcos, an opposition member of Congress, Ramon Mitra, contrasted the White House briefings on Reagan's condition with the secretiveness that prevailed during the lengthy period that Marcos, 67, did not appear in public and many of his close associates thought he was near death.

"It boils down to one word," Mitra said. "It means credibility."

In Moscow, where the fatal illnesses of three top leaders were kept secret during the past two years, government spokesman Vladimir B. Lomeiko declined to comment on Reagan's hospitalization, saying: "It is not in accordance with our traditions to make any kind of speculation with regard to the illness of one political leader. We do not think it is justified in terms of ethics to make any kind of speculation around the bed of a sick person."

Soviet party leader Mikhail Gorbachev sent a message of sympathy to the president as did the leaders of other nations.

In Japan, where the mention of cancer is almost taboo, many people were surprised that Americans could speak so frankly about the president's illness.

"It demonstrates the strength of the U.S. political system that it was possible to tell the public of the results so bravely," the daily Yomiuri Shimbun declared in an editorial.

Mainichi Shimbun took a similar line, saying, "In the United States, the Constitution clearly lays out who will take over if the president cannot conduct his duties. This may be a fundamental reason why the illness could be treated so openly. In Japan, when former prime ministers Hayato Ikeda and Masayoshi Ohira fell ill, the real sickness was hidden, treated as top secret."

The president's operation and the announcement that the tumor that had been removed was malignant were front-page news from Jerusalem to Nairobi, Kenya, and from Moscow to Beirut.

The Associated Press reported from London that the dollar fell to its lowest level in a year on foreign exchange markets and gold bullion prices edged up.

Speculation about how Reagan's illness would affect U.S. domestic politics and foreign relations was a major focus of many newspaper and television reports in Western Europe. There was particular concern about the effect on the summit meeting with Gorbachev scheduled for November in Geneva.

"Regardless of all the good wishes which go to the American president at this time, nobs might now be tempered, for what senator would like to be accused of making things difficult for man assured of the sympathy of all Americans? Reagan's weakness could provide him with new strength."

In many countries there was warm praise for the president.

"We like him," said a senior Foreign Ministry official in Tokyo. "He's a very compassionate man . . . . He's a man who represents the good old America to Japan. Whatever strains we find occurring, the kind of personality he showed to the Japanese public eased the tension."