South Korean opposition forces today staged the largest antigovernment demonstration permitted during the six-year rule of President Chun Doo Hwan.

About 20,000 people overflowed a theater into the streets of this port city to hear opposition leader Kim Young Sam, referring to the ouster of Philippine president Ferdinand Marcos, warn Chun that he can have a peaceful revolution now or a violent one later.

"I hope Chun will not be a second Marcos but if he keeps turning a deaf ear to the demand for democracy, he will have to flee the country," Kim Young Sam told the wildly cheering crowd of his hometown. Kim Young Sam, an adviser to the New Korea Democratic Party, which called the rally, has spent about two years of the last 6 1/2 under house arrest.

Today's demonstration was the first in a series of three major provincial rallies planned by a coalition of opposition groups seeking to collect 10 million signatures in an effort to force Chun to rewrite theconstitution and allow direct presidential elections.

Chun, in an apparent response to the mood for democratization that the Marcos ouster has stirred, has relaxed some of the restrictions previously imposed on opposition political activities. The shift appears to reflect a new policy by Chun in recent weeks, after his efforts to block the campaign by house arrests and police action prompted criticism in South Korea and from some of Seoul's allies, including the United States.

Riot police, who in the past have prevented opposition politicians from entering the headquarters of their own parties, did not keep today's rally from being held, but they did prevent post-rally demonstrations. The signature drive for constitutional reform, at one time deemed illegal by the government, also has been allowed to go ahead.

Chun, a former general who seized power in a military coup in 1980, had a new constitution written later that year and attained the presidency in an indirect election in which he got 92 percent of the vote.

Neither Kim Young Sam nor Kim Dae Jung, an opposition leader who polled 46 percent of the vote in South Korea's last direct presidential elections 15 years ago, were allowed to run against Chun in 1981.

Kim Dae Jung, who was scheduled to address the rally, was prevented by police at Seoul station this morning from boarding a train for Pusan, long an opposition stronghold. Anticipating that action, Kim Dae Jung had prepared a taped speech that was broadcast here to the theater audience.

Kim Dae Jung called Marcos' ouster a "golden opportunity" for Koreans to restore democracy in their own country. Since returning from exile in the United States a year ago, he has been under house arrest 13 times.

Although Chun has promised to step down and give Korea its first peaceful transfer of power in modern history, he has opposed rewriting the constitution until after the 1988 Olympics Games, which Seoul is to host. He also has called on the opposition to cooperate with the government in what he called a period of "grand politics" -- essentially a period of non-confrontation between opposition and government forces -- to ensure the success of the games.

Chun has warned that Communist North Korea plans to sabotage the Olympics. And in recent days, Defense Minister Lee Ki Baek and Information Minister Lee Won Hong have warned that North Korea is stepping up activities in the military and propaganda fields.

However, Kim Young Sam said that Chun's invoking the Olympic Games as a means of putting off constitutional reform is no different from the political use Adolf Hitler made of the 1936 Olympics.

"To delay democracy is to deny democracy," Kim Young Sam said at the rally. "People do not exist for the Olympics; it is the Olympics that exist for people."

Kim Young Sam also accused the government of "using absurd means" to try to prevent the holding of public rallies for constitutional reform. He said that the government prevented his people from renting a large stadium, forcing them instead into a small theater.

A university professor here confirmed charges by Kim Young Sam that the government put pressure on civil servants and students not to attend today's rally.

"We were instructed not to go Sunday and we were also told to tell our students that the rally will be dangerous," the professor said.

Organizers of today's rally intended to march from the theater to the office of a local opposition politician, but thousands of riot police, using skillfully coordinated crowd-control tactics, quickly broke up the crowd and prevented people from joining the demonstrators.

Police wearing sports clothes and white running shoes, pushed demonstrators onto narrow sidewalks. Linking arms, the plainclothes riot police cut off the entrance to the street in front of the opposition politician's office.