Secretary of State George P. Shultz has asserted that the United States has a legal right to use military force against terrorists or states which support or encourage terrorism, but some experts on international law dispute his view.

Shultz, who previously cited practical and moral grounds for attacking terrorists, added a legal justification in a Jan. 15 address to a conference on "low-intensity warfare" at National Defense University here.

Shultz was responding to British Prime Minister Margaret Thatcher's statement that retaliatory or preemptive strikes against another country to punish or prevent terrorism are "against international law" and could lead to "a much greater chaos."

Declaring such restrictive views to be "absurd," Shultz said that under international law, "a nation attacked by terrorists is permitted to use force to prevent or preempt future attacks, to seize terrorists, or to rescue its citizens, when no other means is available."

Shultz also said "there is substantial legal authority for the view that a state which supports terrorist or subversive attacks against another state, or which supports or encourages terrorist planning and other activities within its own territory, is responsible for such attacks."

Shultz quoted a Jan. 7 statement by President Reagan that Libya has committed "armed aggression against the United States under established principles of international law" by providing "material support for terrorist groups which attack U.S. citizens."

State Department Legal Adviser Abraham D. Sofaer, who provided a legal opinion to Shultz as part of basis for the secretary's speech, cited the right of self-defense under the U.N. Charter and various U.N. resolutions to back Shultz's statements.

Sofaer said in an interview that international law does not permit "retaliation" against terrorism but added, "We are allowed to strike back to prevent future attacks" under the doctrine of self-defense.

The position expounded by Shultz is "logical, sensible and moral," Sofaer said.

Sofaer said the "Shultz doctrine" represented the State Department view rather than a position coordinated with other government agencies, although the Jan. 7 Reagan statement had been given intragovernmental clearance.

Shultz's statements were sharply disputed by Prof. Alfred P. Rubin of the Fletcher School of Law and Diplomacy at Tufts University, who was chairman in 1985 of the International Law Association's committee on international terrorism. "In the context of the Libya situation, [Shultz's views] are so far out as to be almost non-discussable. They are outrageous as applied to Libya," he said.

If the United States has the right under law to attack Libya because training camps for Palestinians are located there, then the Soviet Union could lawfully invade Honduras because of its support for U.S.-backed rebels against Nicaragua, or even hold the United States legally responsible for training camps for insurgents on U.S. territory, Rubin said. "A fundamental rule is the rule of reciprocity," he said.

Prof. John F. Murphy of Villanova Law School, author of a recent book, "Punishing International Terrorists," said it is difficult to evaluate Shultz's doctrine in the abstract, because the particular facts would be crucial to whether force could legally be used. Murphy said a 1970 United Nations Declaration on Principles of International Law, also cited by Sofaer in another connection, provides that nations "have a duty to refrain from acts of reprisal involving the use of force."

In the case of a preemptive strike, Murphy said, a clear-cut case would have to be made about the identity and actions of the groups being attacked.

Another international law expert, Prof. Edith Brown Weiss of Georgetown Law School, called Shultz's statements "a new theory" and said "they come close to suspending international law for terrorism."