Nicaraguan President Daniel Ortega said today that U.S. economic sanctions would worsen an already "critical economic situation" in his country and compared President Reagan's policies to those of Adolf Hitler.

Ortega appeared at a joint news conference here with Spanish Prime Minister Felipe Gonzalez, who hosted Reagan earlier this week. The Spanish leader seemed at pains to disassociate himself from Ortega's comparison of the United States to Nazi Germany.

"The United States played the leading role in liberating Europe from Nazism and fascism," Gonzalez said, "and I am sure it would do so again."

Ortega, who visited a Nazi concentration camp two days ago in Poland, said the graves there reminded him that "Reagan has killed 150 children" through the actions of U.S.-funded rebels in Nicaragua, "and wants to convert Nicaragua into a concentration camp.

"To say that he is emulating what Hitler did is no exaggeration."

The Nicaraguan leader's comments came after a private three-hour lunch with Gonzalez. Ortega arrived here this morning for what is being termed a three-day "technical stopover" at the end of a Soviet Bloc tour that began April 28 in Moscow.

Next week, he will travel to France, Italy, Sweden and Finland which, like Spain, currently are governed by socialist or social democratic parties.

Gonzalez said that he had no interest in mediating between Managua and Washington. But he said that Spain could play a role in promoting peace and dialogue because of its historically good relations with the two countries.

Reiterating his opposition to the sanctions announced by the White House May 1, Gonzalez said that Spain would continue its policy of aid and trade with Nicaragua, and was considering adding to a current $40 million credit line. He said Spanish military aid to the Sandinista government, however, would be a "mistake."

Gonzalez suggested that "it would be good for there to be a verbal deescalation, and I don't mean just unilaterally, but multilaterally as well" between the United States and Nicaragua.

"There should be respect for the sovereign decisions of each nation, and respect for the international rules of the game."

Ortega's Western European swing was tacked on hastily to the 14-day Soviet Bloc tour following western criticism of the timing of his departure for Moscow. The trip came within days of a congressional vote blocking a White House-requested resumption of aid to the rebels, and helped contribute to the administration's decision to impose sanctions.

During his talks with Reagan last week, Gonzalez pushed for a resumption of the talks conducted in Mexico for several months last year between the United States and Nicaragua. The administration stopped the dialogue, charging lack of good faith by Managua.

The administration has demanded that the Sandinistas hold direct talks with the rebels. But Ortega said today that "the head of the contras," as the rebels are known, "is Reagan. To talk to Reagan is to talk to the contras."

Officials here have characterized "differences" between U.S. and Spanish policy over Nicaragua as centering around the U.S. assessment of the Sandinista slide toward "totalitarianism" as "irreversible." The Spanish position is that the Nicaraguan revolution is still in a formative stage and that continuing U.S. pressure including the sanctions, will push Managua ever more into the arms of the Soviets.

But Gonzalez and other officials also have been privately critical of what they see as Sandinista excesses and failure to fully implement the Sandinistas' "original program."

In the news conference today, Gonzalez made repeated references to the Sandinista promise of "political pluralism, nonalignment and a mixed economy." While he said that steps such as censorship taken by the Sandinistas were somewhat understandable because of the ongoing war in Nicaragua, he called on Ortega to end these "extraordinary measures" as soon as the war ended.

Gonzalez believes himself to be in a special position regarding Nicaragua, officials here have said, not only because of Spain's historical ties with Latin America, but also because of his own leftist credentials and his personal contacts with a number of Latin American leaders.

But the Spanish leader has been pressed by the left in his country to be more outspoken in his support for the Sandinistas and his opposition to U.S. policy than he apparently would like to be.

Ortega spent much of the news conference defending his trip to Moscow as necessary for Nicaragua's economic survival.

U.S. economic pressure had begun several years ago, he said, with administration cancellation of aid programs and efforts to block international loans to Nicaragua. When the United States assisted in rebel mining of Nicaraguan harbors and the subsequent damage to oil shipments, "the Soviet Union sent us oil," Ortega said.

"When the United States canceled credits with which we buy wheat and cooking oil, the Soviet Union was the first country that sent them to us," he said.

Thus it was natural, Ortega implied, that Nicaragua would turn to the Soviets for help.

"Our visit to the socialist countries . . . provoked a reaction in the United States," Ortega said. "But it is good to remember that Nicaragua is not a state of the U.S. states. It doesn't have to ask permission of President Reagan to go to Moscow, to Paris, to Spain or to Bulgaria."