Marshal Nikolai Ogarkov, the Soviet chief of staff, has proposed sweeping measures to modernize Soviet strategic forces and put the country on a virtual war footing to respond to the Reagan administration's "active preparations for a nuclear war."

In a book, just published by the Ministry of Defense, Ogarkov--who is the country's highest ranking soldier--warned Kremlin leaders against any delay in perfecting Moscow's ability to "strike a devastating counterblow and destroy the aggressor under any conditions and in any given situation."

Ogarkov's warning included--and went beyond--a call for new and more powerful weapons. It called for total military preparedness not only by the armed forces and military industries but also of all sectors of the economy, the party and civil defense.

Western diplomats here said it reflected growing uneasiness among the Soviet military leaders over the Kremlin's current stance toward President Reagan's military policies and his stated quest for strategic superiority over the Soviet Union.

The publication of his book would appear to place major questions of military and strategic doctrine before the Kremlin leadership, questions that, in turn, raise basic issues of allocation of resources at a time when the Soviet economy is already strained.

The changes in military technology, or as he put it, "the fast pace of the development of nuclear missile weaponry by the adversary and the possibility of their sudden use" against the Soviet Union, call for new steps "to secure the vital interests of our people."

"To understand this dialectical process is especially important at this stage when the basic scientific progress in weapons systems is renewed every 10 to 12 years," Ogarkov wrote.

"In these conditions, the failure to change views in time, stagnation in the development and implementation of new questions of military construction, are fraught with serious consequences."

He reaffirmed the Kremlin position that it would use nuclear weapons as extreme means of self-defense, but the tone of his book, "Always Ready to Defend [the] Fatherland," stood in contrast to recent pronouncements by President Leonid Brezhnev and other Soviet officials.

Ogarkov said the Soviet Union made a mistake before World War II when it pursued a "defensive" strategy. The mistake was "corrected" in 1942 when the Soviets established large tank armies in their westward drive.

He said a new war would be a cataclysmic confrontation between the two systems--socialism and capitalism--and that it would quickly engulf all continents.

The nature of a new war with the use of nuclear weapons, Ogarkov continued, required not only military preparedness on the part of the armed forces but similar measures by the entire nation.

"In the earlier wars, the question of quick mobilization had not been clearly defined," he said. "The situation is different today. The element of suddenness played a role as early as World War II. Now it has become a factor of greatest strategic importance. The question of a timely switch of the armed forces and the entire economy to a war footing . . . has become sharply defined.

"In order to increase the military preparedness of the country, today as never before, it is necessary to coordinate mobilization and deployment of the armed forces and the entire economy and particularly the use of human resources, transport, communications and energy to secure the stability and livability" of the country.

He said the industries involved in arms production should "improve their cooperation" and secure autonomous supplies of water and energy in the eventuality of war. They should also establish reserves in machine tools and raw materials.

Ogarkov said the links between the economic and civil defense should be improved, describing this as "one of the most important conditions to sustain the required levels of defense capacity for the entire country."

To achieve national objectives in the new conditions of modern war, he said, "is not possible without a stable, centralized system of leadership of the country and the armed forces." It requires, he added, "an even greater concentration of management."

He said the armed forces have to improve the command-and-control system and acquire "the necessary modern technology." He called for modernization of the naval and air forces and improved training for reservists.

Ogarkov called for a decisive struggle against pacifist views among Soviet youth and also warned that the effectiveness is sometimes hampered by conscripts' failure to speak fluent Russian. This was a reference to conscripts from various national minorities.

Apparently reflecting the military's efforts to get a greater share of the budget, Ogarkov said that the need for materials now have increased "tens of times." At the same time, he said, dated equipment and techniques have to be abandoned, much in the way the cavalry was made obsolete by motorized vehicles.

Ogarkov said that Moscow's reliance on large tank forces should be "carefully studied" in view of the appearance of new antitank weapons. "To ignore this would be dangerous," he added.

He placed the main emphasis on the strategic missile forces.

"The level of development of the socialist economy allows us to resolve successfully the most complex technical questions and develop any new type of weapon in a short period of time," he said.

"We are talking about not simply being able to defend ourselves by confronting the aggressor with the corresponding passive means and methods of defense but also to strike a devastating counterblow and destroy him under any conditions and in any given situation."

Ogarkov described the other part of the military doctrine as being political work with soldiers and the rest of the population to teach them "what is necessary to do in war to defeat a powerful and technically equipped adversary under any conditions."

He said the evolution of American strategic doctrine shows that the United States has always entertained the idea of destroying socialism. "This course has become particularly dangerous in connection with the Reagan administration's confrontational strategy and its direct and all-embracing preparations for war," he wrote.

Ogarkov sketched a picture of an encircled Soviet Union with NATO in the West; U.S. military presence in the south; arming of the Afghan rebels and "a long-term military threat" in the Far East, created by the "expansion of military and political ties" among the United States, China and Japan.

He compared Reagan's quest for military superiority with what he called similar attempts by Napoleon and Hitler. Both men failed, he said, adding that "an even more drastic finale awaits the new pretender."