Rightist senior military officers are preparing to oppose a secret government program that calls for their retirement and for the abolition of regional military districts designed to combat "internal enemies," informed officials said today.

Word of the project, which would affect thousands, of armed forces officers who fought for the late dictator Francisco Franco in the 1936-39 civil war, has sparked serious opposition among senior military commanders, sources said.

The plan lowers the retirement age from 64 to 55, officials disclosed. It also proposes doing away with the present 11 military districts whose commanders wield great political power. The district will be reduced to six territorial commands with purely military duties, sources said.

At stake are the jobs of 162 army generals, including 19 lieutenant general's who hold the country's top military posts, and thousands of colonels, majors and captains. The top ranks of the smaller air force and navy will also be weeded out.

Officials explained that the proposed reduction in the retirement age will break the rigid promotion system established by Franco, making way at last for sophisticated young officers to rise in rank and replace some of the oldest general officers in Western Europe.

Another reason for reorganization source said, was to prepare the Spanish armed forces - particularly the Franco-oriented army and the arch-conservative navy officer corps - for possible Spanish membership in the North Atlantic Treaty Organization.

A number of senior civil war veterans on active on duty reportedly have complained to Western diplomats that they are being "purged" for their anti-Communist politics. Most of the country's top commanders opposed the government's legislation of the Communist Party last April.

The government apparently intends to soften the blow by offering forcibly retired officers jobs in the vast net-work of state-owned enterprises, long a source of sinecures.

For months King Juan Carlos, commander in chief of the armed forces; Premier Adolfo Suarez and Lt. Manuel Gutierrez Mellado, now defense minister, have held intense discussions on the reorganization of Spain's military establishment, according to informants.

Gutierrez Mellado has long favored streamlining the armed forces and weeding out older officers. He himself retired last month at the age of 64 after being appointed to the newly created Defense Ministry.

Officials described the project as part of a long-range reorganization of the armed forces intended to open the way to the promotion of officers "with modern training and ideas who sympathize with democracy."

Premier Suarez, who begins a tour of four Western European capitals later this month to promote Spain's application for admission to the European Economic Community, will also discuss Spain and NATO during the trip, officials said.

Spain was excluded from the Common market and the Western military alliance because of Franco's World War II support of the Axis powers. A number of top Spanish commanders fought for Adolf Hitler against the Soviet armies and earned high German decorations that they wear to this day.