British Prime Minister Margaret Thatcher said yesterday she and President Reagan agreed that no "Star Wars" antimissile defense system would be deployed without future negotiations with the Soviets, although research on the system should move ahead.

The agreement, following two days of meetings at Camp David, was viewed as an attempt by Reagan to soothe fears raised by a system that could not be deployed for many years anyway, and an attempt by Thatcher to smooth over political differences with Reagan that grew out of the trip to London of Soviet politburo member Mikhail S. Gorbachev.

U.S. officials confirmed Thatcher's version of the agreement.

Thatcher said yesterday that despite her concern about avoiding an arms race in space, she fully supports U.S. research into space weaponry.

"We see matters in very much the same light," Thatcher said. She made her comments during a news conference at Andrews Air Force Base before she boarded her plane for London.

Her aim, she stressed repeatedly, was to make clear that recent remarks attributed to her should not be interpreted as a sign that she opposes the Reagan administration's Strategic Defense Initiative -- the "Star Wars" research into a space-based defense against Soviet missile attacks.

Her reaffirmation of Britain's support was of major importance to Reagan because it came a week after British government sources said that she and Gorbachev had agreed, in private talks, that there is a need to prevent the arms race from spreading to space. Reports of her concern, coupled with public criticism of the "Star Wars" idea by French President Francois Mitterand, had prompted fears among U.S. officials that the western alliance might appear divided and indecisive about nuclear strategy.

Administration officials are especially concerned that the Soviet Union might get the impression of a lack of resolve in the West on the eve of the Geneva meeting next month where Secretary of State George P. Shultz and Soviet Foreign Minister Andrei A. Gromyko will seek to launch new U.S.-Soviet arms control negotiations.

Thatcher sought to deal with the problem yesterday by drawing a distinction between research into space weaponry and the production and deployment of such weapons.

She noted that under existing international agreements, such as the 1972 Antiballistic Missile Treaty, research is permissible. But, she added, deployment of space weapons is something that would have to be negotiated by the signatories to the ABM Treaty and is not expected to become a substantial issue until toward the end of the century.

"I told the president that the SDI research program should go ahead," Thatcher said. She added that she and Reagan had agreed jointly on four points designed to clarify the situation:

* "The U.S. and Western aim is not to achieve superiority but to maintain balance, taking account of Soviet developments.

* "SDI-related development would, in view of treaty obligations, have to be a matter for negotiation.

* "The overall aim is to enhance, not to undermine, deterrence.

* "East-West negotiations should aim to achieve security with reduced levels of offensive systems on both sides. This will be the purpose of the resumed U.S.-Soviet negotiations on arms control."

"I think you'll find that all the questions about my position are dealt with in the four points," she said. "First you have to do the research as a matter of balance. The Soviet Union already is doing such research.

"The United States, as a matter of balance, has to do similar research within existing agreements. If it is decided to go ahead with production and deployment, that has to be a matter for negotiation because deployment is covered by treaty obligations," she added.

Reagan and other officials such as Defense Secretary Caspar W. Weinberger have intimated that they consider antisatellite missiles preferable to the current western doctrine that emphasizes deterrence through "the balance of terror."

Thatcher made clear her view that the doctrine known as "mutual assured destruction" has kept the peace for almost 40 years. But she added that arguments about whether it should be abandoned are academic because the research required to produce an alternative system will not produce any results for several years.

A senior U.S. official, who talked with reporters later, acknowledged that it is the administration's policy to adhere to the ABM Treaty.

However, the official continued, U.S. concern about Soviet adherence to the treaty is a major reason why the administration wants to explore possible new approaches such as the SDI. "We now face problems in the 1980s that didn't exist in the '60s." he said.

He said that was why Weinberger in a speech last week referred to the mutual assured destruction doctrine as a "simplistic" and "disproven concept." Reagan said Friday that he did not believe "there's any morality" in relying on weapons that would kill millions and added, "We're trying to look for something that would make these weapons obsolete . . . ." Asked about those views, Thatcher replied, "The fact is we have had peace in Europe for what next year will be 40 years. I believe the deterrence of nuclear weapons and the knowledge that their use would be so horrific has in fact helped to keep the peace.

"That kind of policy is what we're going to have to live with for some time because the research to find something else will take some time," she added.

She also discussed reports that she had been highly impressed by Gorbachev, a possible future head of the Soviet Union who sought in London to stress Soviet concern about the "Star Wars" program.

She said her talks with Gorbachev had been "businesslike and friendly" but "without rose-tinted glasses." Thatcher said she had told him the Soviet Union would be very mistaken if it thought the United States and Britain can be divided on arms control questions.

"Wedge-driving is just not on," she said she had warned Gorbachev.