WARSAW, Poland (AP) _ Police detained more than 20 people Friday during rallies in the southwestern city of Wroclaw protesting high school military training and political prisoners, opposition spokesmen said.

An opposition group told delegates to an international conference of parliamentarians in Warsaw that restriction of human rights in Soviet-bloc nations hinders creation of ''a common Europe.''

Solidarity activist Jozef Pinior said police in Wroclaw used clubs to break up a demonstration of about 1,500 people, most of them young, organized by the Interschool Resistance Committee against military training in high schools.

Officers charged as the young people marched to the office of the district school administrator to deliver a petition, Pinior said, and about 20 people were detained.

Earlier, Wroclaw police took three people into custody after a rally by a Polish-Czechoslovak Solidarity group about political prisoners in Czechoslovakia, Pinior's wife Maria said.

About 800 people marched to the center of the city, some carrying a huge banner reading ''Stalinism will not win in Czechoslovakia,'' she said, and leaders of the march distributed leaflets with the names of 22 political prisoners in Czechoslovakia.

Polish-Czechoslovak Solidarity seeks to develop links between the Polish and Czechoslovak opposition movements. Activists from both countries have held several clandestine meetings along the mountainous frontier between the two Soviet-bloc countries.

The conference of about 150 legislators from 33 countries in Europe, the United States and Canada runs from Saturday through Monday by invitation of Roman Malinowsky, speaker of the Polish parliament.

Among those scheduled to attend is U.S. Rep. Tom Lantos, a Democrat from California.

Topics to be addressed include ''Parliaments and Democracy'' and ''Cooperation in the Name of Europe's Future.'' Organizers say it is the first conference of legislators from the Eastern bloc and the West.

An open letter to partipants from the group Freedom and Peace released Friday said, ''The fight for respect of human rights is closely connected with the striving for a united Europe.''

It questioned whether the Western delegates should meet with East bloc parliamentarians, declaring: ''An equal cooperation of parliaments resulting from free elections with those which are a result of appointment confirms the undemocratic political system.''

''Only live contacts'' among peoples can create ''the living tissue of a common Europe,'' the letter said. ''Today such contacts are made difficult by the authorities of East European countries, by limiting possibilities of expressing one's views, limiting information, violating the secret of correspondence, limitation of freedom of travel, etc.''

Copies of the letter were given to Western news agencies in Warsaw.