Former defense secretary Robert S. McNamara charged yesterday that the Reagan administration "does not have a plan" for arms control, and "has not thought out" its attempt to reduce offensive weapons while permitting the development of defensive systems.

"No one knows how to write a treaty that both limits offensive arms and permits defensive arms," he said in a sharp attack on the intellectual foundation of the Reagan arms control program.

Instead, McNamara called on the administration to trade off the president's Strategic Defense Initiative in return for a "large reduction in the number of Soviet ICBM warheads." The defense secretary in the Kennedy and Johnson administrations made his remarks in discussing an article he has written with nuclear physicist Hans A. Bethe in the July Atlantic magazine.

McNamara, who recently returned from the Soviet Union, said, "The Soviets will never sign another agreement limiting offensive nuclear arms" so long as the United States pursues the Strategic Defense Initiative, known as "Star Wars." That view was reflected in a Pravda article Tuesday by Soviet Chief of Staff Marshal Sergei Akhromeyev, who said pursuit of strategic defense by the United States would endanger the future of "the arms control process."

In their article, McNamara and Bethe say the administration should continue missile defense research but at the same time strengthen the 1972 Anti-Ballistic Missile Treaty to prohibit tests associated with development of such systems.

"If we are unwilling to refrain from the tests . . . the Soviets will, with good reason, assume that we are preparing to deploy defenses." The authors continue, Moscow "will assiduously develop their response, and the prospect for offensive arms agreements at Geneva will evaporate."

In tracing the history of nuclear weapons development since the Hiroshima bomb was dropped 40 years ago, the authors say that "each side must recognize that neither will permit the other to achieve a meaningful superiority" and that "attempts to gain such an advantage are dangerous as well as futile."

In criticizing current administration planning, McNamara said the president's strategic defense program had "unattainable" goals, and a partial missile defense "would almost certainly lead to a rapid escalation of the arms race and its extension into space."

On the other hand, he said, strengthening the ABM treaty would permit both sides "to address the primary objective of offensive arms control."

In an echo of the Reagan administration approach to strategic arms reductions, McNamara said, "What is needed is deep cuts in the number of warheads, but cuts shaped to eliminate the fear of first strikes."

In a related matter, McNamara said he supported continuation of the 1979 SALT II treaty limits on offensive weapons, although he conceded that both sides could continue to increase their strategic warhead numbers under the unratified agreement's provisions. Some limitations, he said, are better than none at all.