Prime Minister Yasuhiro Nakasone, ignoring opposition protests, is firmly hinting that Japan is willing to help research and construct President Reagan's proposed "Star Wars" antimissile system.

"It is a nonnuclear and defensive system which would kill the force of nuclear missiles," Nakasone told Japanese legislators earlier this month. "Its goal is to wipe away nuclear weapons from the face of the earth."

His suggestions of aid are drawing heavy fire from Japan's opposition parties, which contend that Japanese cooperation would further involve the country in the world's nuclear confrontation and jeopardize postwar principles against nuclear weapons.

Nakasone's stance poses difficult questions in Japan. Since World War II, it has accepted the deterrent protection of the U.S. nuclear arsenal but, with memories of Hiroshima lingering, has tried to avoid direct cooperation.

With Star Wars and a Japanese role in it still only hypothetical, Nakasone appears to hope that at a minimum, his statements will underline Japan's commitment to the United States and western alliance.

Some analysts have suggested that he also wants to defuse mounting pressure from Washington for trade concessions.

Under the Star Wars concept, also known as the Strategic Defense Initiative, nuclear missiles would be destroyed in flight by laser beams or another high-technology weapon. Critics have said it is not technically feasible and even if it were, it could reduce security by destabilizing the balance of power between the United States and the Soviet Union.

British Prime Minister Margaret Thatcher has strongly endorsed further research into the concept. Other countries of Western Europe have shown reservations about it, however.

Talk here of a Japanese role began last month, after Reagan and Nakasone met in Los Angeles. Nakasone told reporters he had expressed "understanding" to Reagan of the U.S. desire to study the idea.

Later, under questioning from opposition members of the national assembly, Nakasone said Japan was reserving judgment on the program's value. But he would not rule out the possibility of Japanese scientists going abroad to work on it.

He rejected the suggestion that Japanese aid would violate the country's "three nonnuclear principles" -- nonproduction of nuclear weapons, nonpossession of them and nonintroduction of foreign powers' bombs into Japan -- saying they applied only to Japanese soil.

Opposition parties fight to uphold those principles but argue that they are not respected by the government or the United States. Many of the U.S. warships that routinely call at Japanese ports carry nuclear weapons, they say.

Nakasone's statements also have drawn fire from the Soviet Union, which contends that Japan's military ties with the United States are a provocation. Yesterday, a commentary by the official Soviet news agency Tass said Japan was forgetting "not only the tragic past" but its nonnuclear principles as well.

But Nakasone has drawn a positive response in Washington. This week, Vice President Bush was reported to have told visiting Japanese legislators that their country's support was vital to the success of the program.

The two governments have exchanged no official communication on the subject, but Japanese officials said that could happen soon.