President Reagan has asked allied leaders in personal letters not to undercut U.S. sanctions against Libya by replacing American oil companies and workers being ordered out of that country, administration officials said yesterday.

Reagan's appeal to leaders in Western Europe and Japan was confirmed by the White House as Secretary of State George P. Shultz told a news conference that "to date we haven't made much headway" in persuading other nations to join the U.S. sanctions, aimed at Libyan support of international terrorism.

Indications that the administration has lowered its stance to a "don't undercut" posture came from several official sources.

In just about his only optimistic remark regarding allied reactions, Shultz said, "I think that there will be a reluctance to move into the roles in Libya that the United States is leaving." Another senior official said "the main thing" the administration is seeking right now is that the allies not undercut the U.S. sanctions ordered by Reagan Tuesday.

Four American oil companies, with an unknown number of American workers, are reported to be responsible for 70 to 80 percent of Libya's crude oil production and an important share of the marketing of Libyan oil in Europe and elsewhere. If U.S. workers leave and are not replaced, an official said, "our sanctions would stick."

Deputy Secretary of State John C. Whitehead will travel to European capitals next week to "explain our point of view," Shultz announced. Holding out little hope for an immediate change in European reluctance to move against Libya, Shultz said that "just because others are not prepared to do the right thing is not any reason why the United States shouldn't do the right thing."

He said the new measures, including the halt of virtually all trade with Libya and criminal penalties for Americans continuing to do business there, were "pretty much at the end of the road" of a gradual progression of economic actions taken by the United States against Libya because of its support of international terrorism.

Following up on the measures announced Tuesday, the Department of Transportation issued regulations yesterday barring U.S. airlines from selling tickets for travel in or out of Libya after Feb. 1.

U.S. banking sources were quoted by United Press International as saying that only a small amount of Libyan deposits and virtually no loan exposure by American banks would be affected by Reagan's order Wednesday freezing Libyan assets in the United States. The Los Angeles Times reported that Libya transferred about $100 million from an American bank to a foreign institution Wednesday, prompting Reagan to act.

"No one contends that these actions by themselves are likely to have a decisive effect," said Shultz, who at one point referred to the U.S. sanctions as "a statement to everybody about how we feel." Predicting that international terrorism is likely to continue, he said the administration is prepared in the future to take "effective" and "necessary" actions to fight terrorism.

"Force is not always the best means, but it may be necessary on occasion," said Shultz, who has argued publicly and privately for military measures against terrorists. Under repeated questioning, however, he refused to discuss what military options have been considered by the administration since the Dec. 27 terrorist attacks at the Rome and Vienna airports or what military options might be considered in the future.

The attacks were carried out by Palestinians reported to be members of a group headed by Abu Nidal, leader of a radical faction at loggerheads with the leadership of the Palestine Liberation Organization. The administration has charged that Abu Nidal has had his headquarters in Libya since early last year and has received support from the government of Libyan leader Muammar Qaddafi.

Shultz charged that Libya provides "safe haven" and "financial support" to terrorists and has distributed arms and explosives from its diplomatic posts abroad.

Qaddafi is providing terrorists with "a certain kind of infrastructure," Shultz said. "So he is involved. He is a terrorist."

On another subject, Shultz said he sees no contradiction between continuing U.S. efforts to persuade Angola to oust Cuban forces from that country and the possible initiation of U.S. aid to antigovernment Angolan rebels headed by Jonas Savimbi.

Shultz said "there have been some interesting developments" in talks this week between Assistant Secretary of State Chester Crocker and the Angolan government, but "I don't expect any sort of major breakthrough."

"We're on Savimbi's side" in his battle with the Angolan regime, said Shultz, who reportedly favors covert aid from the Central Intelligence Agency to the Savimbi-led rebels.