President Reagan said last night the United States is trying to reach agreement with European allies on alternative restrictions to replace trade sanctions he imposed on shipments of oil- and gas-related technology for the Soviet pipeline.

Questioned about the sanctions during a TV campaign appearance broadcast by satellite to 20 Republican fund-raisers nationwide last night, Reagan said the administration is "trying again" to find another set of restrictions against Moscow. "If we can get a better set . . . other than the sanctions, we will be willing to lift" them, he said.

The sanctions have touched off protests among U.S. allies in Europe. Administration officials said previously that the United States would be receptive to other trade restrictions against the Soviets, but this was Reagan's first suggestion that the administration is actively pursuing such an alternative.

His comment came in response to a query from a GOP fund-raiser in Joliet, Ill., for Rep. George M. O'Brien. The questioner told Reagan that Caterpillar Tractor Co. has been "badly hurt" by the sanctions, with "thousands of workers" laid off in Joliet. "Isn't it time to lift those sanctions?" Reagan was asked.

The president -- who last week offered a large grain sale to Moscow and this Wednesday is to campaign in House Minority Leader Robert H. Michel's Illinois district, which also has been affected by the Caterpillar layoffs -- insisted that his sanctions "have hurt the Soviet Union and will hurt them even more."

Reagan said he was "sorry" about the layoffs and added that Caterpillar had also been hurt by unfair trade competition from abroad. He said the United States is "trying again" to reach agreement with European allies on another set of restrictions to replace the sanctions, but did not elaborate. A White House spokesman said later that while there are "ongoing discussions" with the European allies, there are no plans at present to change policy on the sanctions.