Five major candidates for the U.S. Senate in Maryland engaged in their sharpest disagreements to date today over U.S. policy in South Africa and Central America.

The disagreement, during a forum sponsored by the Baltimore Council on Foreign Affairs, mainly was along partisan lines, with former White House aide Linda Chavez, a Republican candidate, firmly supporting the Reagan administration's policy of "constructive engagement." That policy calls for diplomatic means to encourage the white-minority ruled South African government to abandon the apartheid policy of racial separation.

Her opponent in the GOP primary, Richard P. Sullivan, also supported the policy, although he said he could also support some form of economic sanctions "targeted" against the South African government.

The three Democratic participants equally firmly opposed constructive engagement. One of them, Gov. Harry Hughes, called it "wrong, completely discredited." He supported sanctions against the South African government as "a moral declaration" and "the only thing left to do."

Reps. Michael D. Barnes and Barbara A. Mikulski, the other two Democratic candidates, also supported sanctions against the government, although in stronger language, with Mikulski declaring her support for a ban on all imports from that country.

Sullivan broke with the Reagan administration's policy in urging negotiations with groups such as the banned African National Congress, which advocates the overthrow of the South African government.

Chavez, by contrast, placed her views firmly within the parameters of current administration policy, saying economic sanctions would merely harm the black population. She said she favored "building up democratic institutions that will one day allow" majority rule.

Chavez drew murmurs of disapproval from the overflow audience of about 300 when she said she favored the "liberalization of apartheid." Pressed for an explanation Chavez said she misspoke and favored a "liberalization of the regime."

"Apartheid is less onerous today than it was 20 years ago," she said. "It is less onerous today than it was when John F. Kennedy was president, than when Jimmy Carter was president."

On Central America, Hughes said, "We cannot abandon the contras," the forces opposed to Nicaragua's Sandinista government. He said the United States should pursue more vigorous negotiations.

Mikulski and Barnes said they were opposed to aiding the contras. "No war by proxy. No aid to the contras," said Mikulski. She and Barnes endorsed the efforts of the Latin American countries to come up with a regional peace plan, called the Contadora process.

Sullivan countered that one of the goals of the United States should be to "stop the spread of communism." Chavez agreed that the United States must try to stop the spread of Marxist-Leninist policies by the Sandinistas.

Sullivan said he does not believe that the United States should intervene directly to overthrow the Sandinista government.

The Democratic Senate candidates cited arms control as a key problem facing the United States.

Barnes strongly criticized the Reagan administration's May 27 announcement that it would no longer be bound by the limits of the SALT II arms treaty. He also criticized the administration's position on Antiballistic Missile Treaty, which affects testing and development, and its stance on the Strategic Defense Initiative or Star Wars plan, which has been a major stumbling block in arms control talks. "I'm enormously pessimistic about the prospects for arms control," said Barnes.

Sullivan and Chavez said that arms control can come about only through a show of strength by the United States and that having a strong defense system is the only way to force the Soviets to the bargaining table.

"Nuclear arms are the symptom . . . they are not the problem," said Chavez. She said the Soviet Union "will reduce arms only when it is required to reduce arms because it has met an adversary in the United States that is its equal."

Maryland's Republican and Democratic primaries will be held Sept. 9.