A top Pentagon official acknowledged yesterday that nuclear war could cause a "nuclear winter" of unsurvivable darkness and cold, but argued that current administration policies are the best deterrent to such catastrophes and denounced astronomer Carl Sagan as "shallow and demagogic."

Richard N. Perle, assistant secretary of defense for international security policy, told a House subcommittee hearing that the administration's policy of building up U.S. nuclear deterrent capability and seeking "deep" reductions in nuclear arms with the Soviet Union is made more urgent by the likelihood of nuclear winter.

"Our policy and doctrine is aimed at preventing a nuclear war and is more so given the consequences of a nuclear winter," he said.

He and Sagan clashed at a joint hearing by the House subcommittees on natural resources, agriculture research and environment and on energy and environment, giving each other low grades on their understanding of the issue.

The subcommittees are studying the possible impact of nuclear winter, the theory that even a small nuclear exchange would generate enough smoke, soot and dust to block sunlight. This could cause a severe temperature drop that would result in widespread disruption of food production, extinction of plant and animal species and possibly the destruction of all life.

Sagan, one of a group that formulated the theory, said that nuclear winter requires "an agonizing reappraisal" of the doctrine of nuclear deterrence and first-strike capability. He denounced the administration's attempt to use the danger of nuclear winter to sell President Reagan's proposed "Star Wars" space-defense program.

"All the nuclear strategy games are geared to first-strike capability, but nuclear winter takes this out of the arena because there is retaliation by Mother Nature," he said. "And I am disappointed in their use of nuclear winter as a soapbox for promoting Star Wars."

Sagan derided Star Wars, which the administration calls Strategic Defense Initiative, as "a Maginot Line in the sky" and added that "you have to be really loony tunes to bet the survival of the world on this." He said that even if Star Wars was 99 percent effective, which was unlikely, it would still let enough missiles through to create nuclear winter.

"If we can destroy half of the Soviets' missiles and they find that unacceptable, the cheapest and most effective recourse is just to double their numbers, which makes nuclear winter even more probable," he said.

He was critical of a Defense Department report to Congress on nuclear war which acknowledged the likelihood of nuclear winter but said more research was needed to understand its effect on the climate and the "biological consequences" of atmospheric changes. He said that, if the report had been submitted for one of his graduate courses at Cornell, "it would get a D, maybe a C-minus if I was in a friendly mood."

He noted that an enormous volcanic eruption in Indonesia in 1815 threw so much ash and smoke into the atmosphere that New England had no summer that year.

"Obviously this can also be the result of a nuclear exchange," he said.

Perle denounced Sagan's testimony as "shallow, demagogic, rambling policy pronouncements" rather than scientific analysis and said he would give Sagan an F on his understanding of the issue.

"We don't know at what level of an exchange that nuclear winter would happen," he said. "But our first conclusion is that we must assure the effectiveness of our deterrence to prevent that exchange. There is no shred of evidence that our current doctrine is not the best policy to prevent war. I agree with him that we need to reduce the number of nuclear weapons in the world."