President Jose Napoleon Duarte says he expects to emerge from the controversial March 28 elections here with new power to control El Salvador's extreme right-wing political parties and his government's own security forces, which he conceded had established in the past a system of "authority by terror" that he is seeking to dismantle.

The president again dismissed any suggestion that he would ever negotiate with the Marxist guerrillas who are attempting to disrupt the elections and to overthrow the U.S.-supported civilian-military junta he heads. In a three-hour interview last night, he expressed fresh optimism on the course of the war against the guerrillas.

Duarte's rejection of negotiations and his optimism echoed those in a separate interview with U.S. Ambassador Deane Hinton.

"They think they have a winning hand," Hinton said of the estimated 5,000 guerrillas the Reagan administration says are being trained, supplied and commanded by Nicaragua and Cuba. Because their leaders are dedicated communists, he said, the guerrillas are not sincere about negotiations and would use them "to gain time and to reposition their forces."

Both Duarte and Hinton expressed skepticism that Mexico could play a leading role in resolving El Salvador's civil war, despite the ongoing contacts between U.S. Secretary of State Alexander M. Haig Jr. and his Mexican counterpart, Jorge Castaneda.

Mexico is attempting to mediate between the United States and Nicaragua as a first step toward ending the war in El Salvador. Asked about the Haig-Castaneda talks that have taken place during the past two weeks, Hinton said that he had been told by Washington that "there was no discussion of negotiations" about El Salvador. "I have no reason to believe that we contemplated it."

He said that "to a certain extent" Mexico might be helpful in ending the conflict. The Mexican leadership has allowed the guerrillas to establish "a base for fund raising and propaganda activities" in Mexico and "they should have a little more leverage on these fellows. For all they say about nonintervention, they have already intervened here" on the side of the guerrillas, the ambassador said. Mexico "should not play the lead, but they are part and parcel" of regional diplomacy to resolve the conflict in El Salvador, he added.

Duarte, who occasionally hinted at apparently deeply felt resentments about the American handling of his country's simultaneous economic, political and military crises, was scathing in his remarks about Mexico.

"I don't see that Mexico has any influence on this," he said in response to a question. "Mexico is not a Marxist government" and will not be able to pressure the leftist forces or Nicaragua. "They are only playing at it. But Mexico has two policies--internally a dictatorship, and externally a socialist-sympathizing government" that supports revolutionaries.

On other points covered in the interview, Duarte:

* Disclosed that he had a serious disagreement, which he described as "a moment of tension," with his military commanders about his determination to prosecute five members of the National Guard for allegedly raping and murdering four American women religious workers in December 1980. Duarte said he could not predict when the accused guardsmen would be brought to trial.

* Said that the $105 million supplemental economic aid the Reagan administration is proposing to send to his totally depleted national treasury this year would be used primarily to purchase agricultural and industrial raw materials that would keep people working. That still would leave the country $300 million short of foreign exchange with which to pay its projected import bill, he indicated.

* Declared that he would welcome U.S. training for his understaffed national and rural police forces as a way of curbing human rights violations by the Army and National Guard troops who now perform most internal security tasks. American congressmen who oppose such training "create more problems for us than they know."

Speaking in slow but surely expressed English during the meeting in his newly decorated presidential palace, Duarte appeared confident that his election campaign, which like that of the other parties by law ended Friday, would provide his Christian Democratic Party with either an absolute majority of 31 seats in the Constitutional Assembly to be elected on March 28, or with enough seats to dominate a coalition government.

Although the assembly is empowered to write its own mandate, it is expected to elect an interim president to serve for one year while a new constitution is being written and new elections are being organized.

The Reagan administration frequently describes Duarte as a centrist, but in this campaign he occupies the left side of the spectrum. The far right has vehemently attacked him as a pseudo-Marxist who has destroyed the economy through land reform and who will sell the country out to the guerrillas. Former Army major Robert D'Aubuisson, the most prominent challenger to Duarte, has promised to wage "total war" against the rebels if elected.

"They are selling the peace of death, the peace of destroying everything," Duarte said of D'Aubuisson and his supporters. But Duarte said the elections will force the extreme right "to accept the rules of the democratic game" and to abandon violent confrontation as a means of seeking power.

"The people will have made their decision, and the extreme right will be bound by these results, like it or not. They won't be able to argue any longer that this government is not legitimate. If they continue to call for coups, that will be sedition and it will be punishable by law."

Reflecting a shift from past automatic denials by the government that its forces have been responsible for a significant part of the estimated 30,000 killings that have taken place during the past 2 1/2 years, Duarte said that the elections would give the new civilian government more authority over the military commanders. Since the October 1979 coup against the government of Gen. Carlos Humberto Romero, the military has operated as a totally autonomous force.

"Two years ago, we had human rights abuses in almost every town. We still have some today but much, much less. Now, it is not systematically and not over all the country. We have taken actions of control, and of punishment," Duarte said.

He added that these controls, plus the land reform and the nationalization of export and finance sectors in 1980, were central elements in his efforts to remove "the conditions of authority by terror" made possible in the past by a tacit alliance between the security forces and the entrenched economic elite of El Salvador.

While urban terrorism has dropped sharply here in the capital, reports by the U.S. Embassy and local human rights organizations show no overall decline in the number of deaths attributed to unidentified killers in recent months. Embassy figures, which do not represent absolute death totals but rather attempt to reflect weekly trends, show a decline over totals of two years ago. But there has been no overall decline in the past several months, and current figures show radical fluctuations from week to week.

Duarte indicated that he would favor continuing in a new term the current policies in the war against the Farabundo Marti National Liberation Front guerrillas, including heavy reliance on the Reagan administration to provide training and weapons for his troops and pressure on Nicaragua and Cuba to stop arms supplies.

"The extreme left is not interested in negotiations or democracy. These so-called negotiations would be nothing but an effort to get an unconditional surrender, or a military negotiation such as the one the United States had in Paris about Vietnam," said the veteran politician, who spent eight years in exile after being cheated out of the presidency by the military in 1972.

Duarte repeated his willingness "to dialogue" with the guerrillas and their political spokesmen "if they accept that the solution here is not a violent or a military one, but a democratic one" that recognizes the legitimacy of the government to be elected March 28. The guerrillas are boycotting the elections as fraudulent.

Speaking at his heavily guarded residence shortly before, Hinton said the Salvadoran Army hopes to add four U.S.-trained battalions to its present level of 13,000 men, supplemented by the existing 9,000-man National Guard and police forces, by the end of the year. Along with the $55 million worth of military equipment the Reagan administration is rushing to El Salvador, he said, this should enable the Salvadoran military to contain the insurgency at its current level.

The Army had come close to inflicting a major defeat on the guerrillas during a sweep over the Guazapa Volcano slopes last month, Hinton asserted. "If they had had another battalion or two of troops that knew what they were doing instead of the troops who were not very well trained or well led, it could have turned out differently."

Duarte once again sharply criticized American coverage of the war, maintaining that the guerrillas had duped journalists into reporting atrocities that the government had not committed. He complained that while the world communist and socialist movements worked in a unified manner to isolate and then destroy individual countries, the democratic world tends to lack similar unity.

"All the Western countries are scared to defend the principles of democracy rather than just obtaining their own objectives. They do not defend with concepts and ideals, but only self-interest. Yes the international policy of the United States has always been that way and it is that way here."