The Carter administration has launched a strenuous diplomatic effort in violence-ridden El Salvador aimed at heading off a repeat there of the civil war and abrupt transition of power that took place in neighboring Nicaragua this summer.

In the past three weeks, William Bowdler, a diplomat who has become the administration's chief Central American trouble-shooter, has made two unannounced visits to El Salvador, where he currently is holding talks with government and opposition leaders.

Early last month, Assistant Secretary of State for Latin America Viron P. Vaky also made an unpublicized trip there. Vaky took a hard line with Salvadoran President Carlos Humberto Romero, reportedly asking him to advance significantly the date of presidential elections now scheduled for 1982.

While Nicaragua's Sandinista guerrillas have vowed not to become involved in El Salvador, and there is no evidence their new government is aiding leftist terrorists and other opposition groups there, the Sandinista victory has added urgency to the situation.

The administration believes El Salvador may become the next country in the hemisphere to erupt into violent revolution -- a prospect that both domino theorists and liberals in the State Department would like to avoid.

Although it now has opted for friendly cooperation with the Sandinistas, the administration is still smarting from its failure, despite two major diplomatic efforts led by Bowdler last fall and during the civil war in July, to install a moderate, pro-U.S. government in Nicaragua.

In testimony last week before the House Subcommittee on Inter-American Affairs, Vaky described El Salvador as the "most volatile" country in Central America. Calling the small overpopulated nation a "classic setting for social and political unrest," Vaky said "the prospects for avoiding insurrectional violence are rapidly dimming."

Vaky outlined "a highly skewed distribution of income, wealth and land," and a class structure that is "one of the most rigid in Latin America."

"Human rights violations," he said, "have been serious . . . [and] the political system has not accommodated dissent and demands for change well."

El Salvador's perennially high level of political violence has increased dramatically in recent months, as the Sandinista success in overthrowing Anastasio Somoza has encouraged El Salvador's guerrillas and panicked its rightist military government.

According to the most recent report of San Salvador's archbishop, a leading government critic, 52 persons were assassinated for political reasons in July alone, allegedly by rightist terrorists supported by the government. Among 59 persons reportedly arrested for political reasons during the month, 24 have disappeared without official explanation, according to church reports.

The government has become increasingly irritated by church criticism. Six priests have been assassinated since the beginning of 1977. Following the shooting murder of the most recent victim, as he knelt at a church altar, even the most conservative faction of the deeply divided Catholic hierarchy denounced the government and demanded action.

Many of the killings on both sides appear to be revenge motivated. Last week a leftist guerrilla group quickly claimed responsibility for the murder last Thursday of President Romero's brother. A cabinet minister, the second in less than 3 years, was murdered last May, and guerrillas have kidnaped a number of foreign and local businessmen, killing at least two.

Seven students died at last weekend when masked gunmen ambushed a car carrying them to a recreation area in the eastern part of the country. On Tuesday, police fired on a group of demonstrators, killing one, and later said the demonstrators had fired first.

One of the reasons observers predict that an insurrection in El Salvador would be more prolonged and destructive than that of Nicaragua is the large number of divergent opposition groups.

Three separate Marxist guerrilla groups currently claim responsibility for terrorist attacks against the government. Three other mass action groups are clandestinely organizing the country's impoverished peasants, students and laborers. The groups rarely coordinate their actions, frequently denounce each other and are all equally attacked by the stridently anticommunist government.

Splits have begun to develop within the traditionally conservative wealthy class which has been the backbone of support for military-led governments over the past five decades. As in the military itself, the economic elite is divided between those who see social, economic and political change as the only alternative to violence, and those who feel the way to deal with violence is first to eliminate the left.

In the middle are a number of opposition political parties dominated by the leading Christian Democrats, who are currently conducting semi-secret talks with the government and other opposition sectors -- and the United States -- in hopes of arriving at a solution that will both stop the violence and give them access to political power.

Romero is under heavy pressure both internally and from outside El Salvador. At its annual General Assembly in Bolivia next month, the Organization of American States will consider charges by its own human rights commission that the Romero government is responsible for numerous political disappearances, harsh repression, including the use of secret "rungeons," and torture.

The extent to which the OAS censures the government may be determined by its efforts to liberalize. The State Department has pressured for and applauded Romero's announcement last month of a series of electroial reforms he said would guarantee free congressional elections scheduled for next March.