Although the United States leads the world in the number of reported cases of AIDS, foreign governments are adopting a variety of aggressive measures from explicit sex-education campaigns to mandatory testing in an effort to contain the potentially devastating epidemic.

Dr. Jonathan Mann, director of the Special Programme on AIDS for the World Health Organization, the U.N. agency that is coordinating global efforts at prevention, urged participants at the Third International Conference on AIDS to cooperate in fighting the disease that may have infected 10 million people worldwide.

Much of the attention of the 6,000 scientists from around the world gathered here this week has focused on the policy issues confronting the more than 110 countries with reported AIDS cases and on the prevention programs of several European nations that have achieved mixed results.

Screening travelers or foreign students to see if they are carrying the AIDS virus, a policy adopted by more than a half-dozen countries, including India, China and Belgium, is largely useless in the modern era of international travel, Mann said.

Earlier this week President Reagan called for mandatory AIDS virus tests for immigrants and the approximately 4 million resident aliens expected to apply for permanent residence. On Tuesday the Senate unanimously approved mandatory testing for immigrants. Tourists are exempt from the U.S. testing requirement.

Mann cautioned conference delegates against thinking that AIDS can be stopped at the border. "There are no geographic 'safe zones' and no racial exemptions," he said.

In the past year, according to Mann, the willingness of many affected countries to acknowledge the seriousness of AIDS has increased dramatically. The fact that AIDS will be a topic at next week's economic summit in Venice, he said, is "remarkable testimony to the broad recognition" of the global scope of the epidemic.

Last night Tass, the official Soviet news agency, reported 54 cases and said that 16 Soviets and three foreigners have died of AIDS in the Soviet Union. The report is the first time that the Soviet government, which has denied AIDS is a problem, has admitted that any deaths have occurred from the disease in its country.

"The change in perspective is very dramatic," Mann said. "A year ago, we couldn't talk in South America or Africa . . . . Now I can't think of a single country that is not ready to collaborate with the WHO."

The international agency's budget for AIDS programs will grow from $1 million last year to $65 million for 1988.

Scientific collaboration is also increasing. Intensive research on treatments and how the virus works is proceeding in Japan, Australia, the Soviet Union and in several European countries as well as the United States.

Field research, which includes charting the epidemic's spread and efforts to collect blood and other specimens, is under way in parts of the Third World, including African countries hardest hit by the disease.

Health officials agree that with a vaccine still years away the only effective weapon against AIDS is education.

In contrast to the U.S. government, which only recently unveiled a public education campaign that will stress abstinence and monogamy and will otherwise recommend the use of condoms, Britain, Australia and Denmark have launched more sexually explicit campaigns.

Some Danish buses are decorated with 10-foot-long condoms painted in the colors of various countries with messages in different languages. The message aimed at American tourists: "Take Care Out There."

Britain began the best known and most extensive campaign with the cooperation of the British Broadcasting Co. last fall with explicit newspaper advertisements and billboards: "AIDS: Don't Die of Ignorance."

Special ads were aimed at British teen-agers. One showed a bouquet with a message: "You know what's in his mind. How can you tell what's in his blood?" and contained a simple explanation that condoms protect females from semen that may be infected with the AIDS virus.

The ads were followed by a weeklong blitz on the BBC that included continuous programs on AIDS and encouraged people to read a pamphlet on AIDS that the government distributed to Britain's 23 million homes.

Lorraine Sherr, a British psychologist, said the campaign achieved a "significant knowledge gain" but did not appear to change behavior.

Dr. David Miller reported that the "rather stark and frightening message" of the British campaign raised anxieties among heterosexuals, considered to be at low risk, who flocked to testing sites.

Miller said a significant number of those who took the test and found they were negative used it "as an example of a clean bill of health" when engaging in "high-risk casual encounters."

In Europe, the epidemic has lagged about two years behind the United States, which reports more than 36,000 cases. In Europe it is increasing most rapidly among intravenous drug abusers, who account for 15 percent of cases there, researchers said.

In the Netherlands, where a government program allows addicts to exchange dirty needles for clean ones, the demand for clean needles has increased from 25,000 to 600,000 in three years, without an apparent increase in drug abuse.

The needle-exchange program, begun in 1984 to stop the spread of hepatitis B, has not seemed to slow the increase in AIDS cases. One possible explanation is that because it can take 10 years to develop AIDS, cases are showing up among addicts who were infected before the program began.

Yugoslavia has 10 reported cases, according to Dr. Slobodan Lang, health commissioner for the city of Zagreb. Graduating high school students in Zagreb receive a pamphlet on AIDS with their diplomas. Health officials have established a telephone hot line and are training volunteers in cities and villages to start similar programs.

"We are a country that has not yet been overburdened in the manner of others," Lang said. "We reacted with what we call a panic of prevention. We hear about the other countries that have not done that in time."

Staff writer Gary Lee contributed to this report.