Salvadoran President Jose Napoleon Duarte, emotionally kissing an American flag to show his gratitude for U.S. aid, told President Reagan yesterday that Nicaragua's Marxist government must negotiate with its contra opponents if there is to be peace and freedom in Central America.

Duarte, a signatory of the five-nation Central American peace agreement, cited as a model for Nicaragua the talks about political amnesty and cease-fires that began last week between his government and leftist Salvadoran guerrillas.

Secretary of State George P. Shultz said afterward that Duarte, in his talks at the White House, told Reagan that "in the cause of peace" he was willing to grant amnesty even to the insurgents who planned and took part in the 1985 kidnaping of his daughter, Ines Guadalupe.

Earlier, when he arrived at the White House to begin a state visit, Duarte agreed that Reagan has reason to be cautious about whether Nicaragua, which has refused to deal with the U.S.-supported contras, can be trusted to carry out the peace agreement's provisions for democratization, amnesty and cease-fires.

"I am convinced that there cannot be peace in Central America without freedom and democracy which, in turn, will only be attained through comprehensive dialogue and negotiated cease-fires," he said. "I also insist that each Central American president has the responsibility to comply fully within its own country with all the obligations contracted, and that no government be permitted to take only cosmetic or half-measures . . ."

Duarte, who has been heavily dependent on U.S. military and financial aid during his three years as president, concluded his remarks by saying:

"Now, President Reagan, let me break protocol. I have seen in my life many times in which people, with hate in their hearts, have put fire to the American flag. This time, permit me to go to your flag and, in the name of my people, to give it a kiss."

He then embraced Reagan and walked briskly across the White House South Lawn to grasp and kiss a fluttering Stars and Stripes.

A senior U.S. official, asking anonymity, said Duarte later told Reagan he expected "a good deal of criticism, especially from the communists, for the gesture. But he wanted to do it as an expression of gratitude to the United States."

Duarte, who is to speak to an unofficial meeting of both houses of Congress today, came here a month after Costa Rican President Oscar Arias, the principal author of the peace plan signed in Guatemala last Aug 7. Arias used a similar session with Congress to voice opposition to the administration's plan to ask Congress for $270 million in new contra military aid.

The administration hopes that Duarte, despite his support for the Guatemala plan, will sound a more cautionary note about Nicaragua's intentions. Some administration officials have hinted that Duarte has indicated privately that he wants contra aid to continue.

The administration, frustrated by the Managua government's refusal to negotiate with the contras, hopes that Duarte, who commands considerable congressional respect, will inject a cautionary note amid the enthusiastic support the peace plan has attracted on Capitol Hill.

The administration's equivocal attitude toward the peace agreement was underscored by the perfunctory, almost chilly manner with which it greeted the Norwegian parliament's action Tuesday in choosing Arias for the 1987 Nobel Peace Prize. When the senior official was asked about the honor to Arias, he replied that it had not been discussed in the White House meeting.

However, at a State Department luncheon hosted by Shultz, Duarte concluded a toast with a graceful tribute to Arias. He noted that Costa Rica, unlike its neighbors, is not burdened by civil war, and he said of Arias:

"He wanted peace -- not for his country. He wanted it for Nicaragua, for El Salvador. He was thinking of all the people who died. He didn't want people to die."

A different response came from Adolfo Calero, one of the most prominent contra political leaders. In a speech here, he called the Nobel award to Arias "premature" and suggested that it might play into the hands of communists. However, another contra political leader, Alfonso Robelo, who arrived in Miami yesterday from Costa Rica, praised the award as "a day of joy for all of Central America."