Two days before a planned nationwide strike by the outlawed Solidarity union, Poland's martial-law authorities announced a firm date for a visit here by Pope John Paul II. The government also announced the arrest of several Solidarity activists, including a member of the underground national leadership.

The announcement that the pope will begin his second visit to his homeland on June 18 was an apparent attempt to defuse protest strikes and demonstrations called for Wednesday by underground Solidarity leaders.

A communique said the country's military ruler, Gen. Wojciech Jaruzelski, and Roman Catholic Archbishop Jozef Glemp, had agreed on the date at a meeting in Warsaw. The Polish-born pope originally had been invited to visit here last August, but his pilgrimage was delayed at the insistence of the Communist government because of tensions.

The timing of the announcement of the pope's visit and the meeting between Jaruzelski and Glemp, their first since April, were politically significant in view of the threatened surge in labor unrest. The underground has appealed to workers to stage a nationwide eight-hour strike Wednesday to mark the second anniversary of Solidarity's formal registration as the first legally recognized free trade union in the Soviet Bloc.

By showing their readiness to welcome the pope in Poland next year, the military authorities also could be seeking to create a conciliatory impression in the West before the resumption Tuesday of the Helsinki review conference in Madrid. The conference, which was convened to review implementation of the 1975 Helsinki declaration on European security and human rights, went into recess last March after bitter arguments between East and West over the imposition of martial law in Poland.

The government tonight announced the arrest of more than a dozen underground Solidarity activists in the southwestern city of Wroclaw, which has been one of the focal points of resistance to military rule. Among those arrested was Piotr Bednarz, the head of the strike committee in Wroclaw and a member of Solidarity's five-man underground national leadership.

The arrest of Bednarz and his associates represents a major blow to the Solidarity underground and a coup for the government on the eve of Wednesday's protests. Bednarz, who was shown on television following his arrest, was chosen as Solidarity leader in Wroclaw to replace Wladyslaw Frasyniuk who was detained last month.

A statement issued after a Cabinet meeting today said the authorities were fully prepared to use "all necessary means to ensure peace, security and undisturbed work," despite Solidarity's calls for strikes and demonstrations Wednesday.

While harshly suppressing protests against martial law, the government is also seeking to hold out a glimmer of hope that political and economic reforms are still possible.

The action last month of the national legislature, the Sejm, in disbanding all trade unions dangerously polarized public opinion here, many political analysts believe. It also created severe strains in church-state relations with Glemp twice refusing to meet with Jaruzelski as a show of disapproval.

Jaruzelski, who is prime minister and Communist Party leader as well as martial-law administrator, made it clear that the setting of a date for the papal visit was dependent on a meeting between him and Glemp.

The official statement gave few details of their talks, other than saying that the two leaders "voiced their joint concern for the preservation and strengthening of peace, social discipline and honest work." The government is likely to interpret this phrase as meaning that the church, which enjoys immense prestige in Poland, does not endorse the protest actions called by the underground.

In his latest public pronouncements, Glemp has consistently expressed support for Solidarity and criticized the Communist authorities for "failing to listen to the voice of the nation." But at the same time he has attempted to distance the church from strikes and demonstrations that he believes could merely result in greater political repression.

Roman Catholic leaders have always taken the long view of political developments in Poland, believing that their most important task is to preserve the nation's sense of identity. This explains why Glemp is setting so much store on a return visit by the pope and resisting pressures from lower clergy for a tougher attitude toward the government.

The pope's last visit here in June 1979 is widely credited with helping to start the social processes that resulted in Solidarity's emergence the following year. The huge, self-disciplined crowds that turned out to greet the pontiff as he toured Poland provided dramatic evidence of the nation's true loyalties and the unpopularity of the Communist Party.

Many Poles interviewed by Western journalists here after today's announcement expressed delight at the prospect of another papal visit, but also some skepticism that it would take place as planned.

"The government is only going to let the pope come if it has the political situation completely under control. But the way things are going at present, there seems little chance of everything being quiet next year," one middle-aged Pole remarked.

The military government has recently come under pressure from both the Kremlin and hard-liners within the Polish Communist Party to put the church in its place. In a newspaper article published last weekend, the head of the party's ideological department said the authorities would resist what he described as "political clericalism of a clearly antisocialist character."

Walery Namiotkiewicz criticized in particular the practice of some priests of paying fines levied on people caught by police in the vicinity of street demonstrations. The fines are frequently as high as two months' average wage.

In another apparent attempt to release pent-up political tensions, television has been broadcasting an uninhibited discussion program on the government's policies. The program was extracted from a seven-hour discussion held last week between the deputy prime minister, Mieczyslaw Rakowski, and an invited audience selected from people who had written letters to the government.

In the first extract, broadcast last night, workers were shown openly criticizing the dissolution of Solidarity and ridiculing official manipulation of the new trade unions. One worker called for a nationwide referendum to reveal the extent of support for the Communist authorities, while a sociologist questioned the right of the Communist Party to remain in power.

Some speakers said that, by suppressing Solidarity, the government was running the risk of reverting to the traditional type of Communist rule that had caused so many crises.

The program also included progovernment speakers and showed Rakowski in a sympathetic light, vigorously rebutting the criticism. Even so, the openness of the debate was remarkable for a country under martial law and could scarcely be imagined anywhere else in the Soviet Bloc.