Pope John Paul II arrives in Central America on Wednesday to face a Roman Catholic Church deeply divided, like the region as a whole, by revolution and its politics.

"Peace" is the message the area's 20 million Catholics hope the pontiff will bring on his eight-day journey. But the question of how he proposes to achieve it has governments as different as the U.S.-backed regime in El Salvador and the revolutionary Sandinistas of Nicaragua seriously concerned.

The clergy, meanwhile, is wracked by bitter disputes about the role priests and nuns should play in the midst of social upheaval, and Catholic congregations are being eroded at an unprecedented rate by the rising strength of fundamentalist Protestant sects.

Since the Conference of Latin American Bishops declared at Medellin, Colombia, almost 15 years ago that the role of the church is with the poor, a "liberation theology" developed that led many members of the clergy into an unprecedented alliance with Marxists. The only way to free Latin America's impoverished masses from centuries of oppression, both groups came to agree, is through revolution.

Pope John Paul, drawing on his experience in Poland and his strongly felt anticommunism, has never been comfortable with this relationship. At a 1979 meeting of the Bishops Conference in Puebla, Mexico, he walked a careful line attempting to reaffirm the church's commitment to the poor even as he opposed the involvement of priests and nuns in secular politics or revolutionary movements.

The violence that has swept Central America since then makes such distinctions increasingly delicate and difficult to sustain.

In the Nicaraguan war that ended with the Sandinista triumph in July 1979, many priests actively participated on the side of the rebels. "Christian base communities" organized by the church during the late 1960s and early 1970s were key sources of organization and manpower for the revolution.

Even the relatively conservative bishops here endorsed the uprising against the dictatorship of Anastasio Somoza.

But when the pope arrives here Friday, after spending a day and a half in Costa Rica, he will find that the church that gave its almost unanimous support to the insurrection is now sharply split. On one side are priests and a few members of the hierarchy still sympathetic to the Sandinistas. Five priests are senior members of the government, two of them Cabinet ministers.

On the other side a majority of the church leadership under Managua Archbishop Miguel Obando y Bravo adamantly oppose what they see as communist abridgements of basic freedoms and of traditional church prerogatives here in fields like education.

As many of the Sandinistas' other political opponents have gone into exile during the last year, Obando y Bravo has become perhaps the strongest voice speaking out against the direction the revolution has taken. The pope is expected to give him firm support.

The issue of priests participating in the government against the wishes of the hierarchy, which has been hotly debated here since 1980, is being temporarily sidestepped. The priests have agreed to refrain from performing the functions of clergy while working for the government and they are expected to maintain a low profile during his 10-hour stopover.

The Sandinistas appear to be worried that the pontiff will make statements that call into question--or could be interpreted as calling into question--their leadership.

"The worst that could happen," said activist priest Rev. Carlos Cabarrus, "would be a condemnation against the revolutionary process. If that happens then the process is going to make itself dogmatic. It will start to close itself up."

The best thing that the pope could say, in the opinion of Cabarrus and other priests committed to the Sandinista cause, is "leave Nicaragua in peace."

The conservative government of El Salvador, however, is worried that the pope will not only call for peace but that he will call for a dialogue between the Washington-backed regime and leftist guerrillas in order to bring it about. The Salvadoran government and the Reagan administration repeatedly have ruled out any sort of negotiations with the rebels that would lead to their sharing power in the government.

The Salvadoran church hierarchy is divided on the question. But Archbishop Arturo Rivera y Damas, whom the pope named today as archbishop of San Salvador after three years as apostolic administrator, is known as a strong supporter of dialogue.

In both El Salvador and Guatemala, which he will visit on Monday, the pope will encounter a clergy that has suffered the murder of many of its members for real or suspected political activism during the past few years. In all more than 30 priests, including Salvadoran Archbishop Oscar Romero, have been killed or have disappeared since the mid-1970s.

Amid all the controversy surrounding the role of the church, evangelical Protestant groups, many of them tied to politically conservative fundamentalists in the United States, have made major inroads in a population that was until the last decade almost entirely Catholic.

In Guatemala the evangelicals now claim 22 percent of the population. Here in Nicaragua, despite active opposition from the Sandinista government which accuses the evangelicals of aiding covert operations by the U.S. Central Intelligence Agency, Protestant sects have grown from 3 percent to 13 percent of the population in the last 3 1/2 years, according to anthropologists at the Catholic university.

On Wednesday, March 9, having visited all the countries of Central America, John Paul will make a brief stop in Haiti where he will open the latest meeting of the Latin American Bishops Conference. By then, having seen the effects of revolution, the pope is expected to have clarified in the minds of his priests and their congregations the role that he has cut out for the church in the region.