Independent presidential candidate John B. Anderson said here today that his first priority as commander-in-chief would be to make the all-volunteer armed services more appealing to enlisted personnel and potential recruits.

Dismissing allegation that America's armed forces are "a shambles," Anderson outlined here and in Boston Tuesday a defense program that would drop the MX mobile missile, improve the readiness of conventional forces and begin to develop more pratical, less expensive, weapons systems.

In stating his position to conventions of the American Legion Tuesday and the Veterans of Foreign Wars here today, Anderson ridiculed both the policies of President Carter and the proposals of Ronald Reagan, the Republican presidential candidate.

Accusing Carter of "weak and vacillating leadership," Anderson said the president's "election-year support for military preparedness cannot obscure four years of neglect." The president "who has presided over [our] decline" should be defeated, he said.

Reagan, Anderson said, exaggerates U.S. problems by saying the armed forces are "a shambles" and calls for an unattainable military superiortiy over the Soviet Union that would be dangerous to the United States and its allies.

On many key points, Anderson's proposals for a new national security policy are vague, but he comes out clearly for ratification of the Strategic arms limitation treaty (SALT II), abandonment of the MX and relatively modest new military spending programs. These can be financed, he said here today, by the normal increase in federal revenues in the years ahead and from savings that will result from retaining more specialists in the services and dropping costly schemes like the MX.

In both his major addresses to the veterans groups, Anderson emphasized that "we cannot have a strong defense without a strong economy."

Anderson said it was a national disgrace that thousands of enlisted personnel today are eligible for food stamps because their pay is so low. He promised big increases in pay scales and changes in military personnel policies that would allow some specialists to remain in the service in the lower ranks until the age of 55 or 60.

Anderson also promised more benefits for veterans, particularly Vietnam vwterans. In a section of his prepared speech that he skipped over in delivery here, Anderson said the government should provide "recompense where due" to servicemen and their children adversely affected by Agent Orange, the toxic defoliant used in Vietnam.

More money should be spent on unglamorous maintenance and readiness needs, Anderson said, adding: "Who can ever forget the humiliation and anguish we experienced as our hostages languished captive in Iran while our helicopters would not fly?"

American weapons now tend to be too complicated and expensive, Anderson said. "Our best fighters now cost much more than the Soviets' best. If we spend less for each plane, we can put more in the air without surrendering our technological edge," he said. Anderson did not explain just how this could be done.

Rejecting the MX as too costly, too dangerous to the environment and too likely to provoke a new buildup by the Soviets, Anderson said: "Surely, American ingenuity can devise a more flexible and more cost-effective" alternative.

Arms control is crucial to long-term American security, Anderson told the American Legion on Tuesday, but "neither of my opponents will lead us in this direction. Mr. Reagan flatly repudiates SALT II, while the Carter administration, paralyzed by the collaspe of its diplomacy, is unable to obtain ratification.

As president, Anderson said, he would "submit to the Soviet Union proposals that will supplement the present treaty and relieve the stated concerns of many senators," without forcing complete renegotiation of SALT II. He did not specify what these proposals would be.

Though he often speaks scathingly of Reagan, Anderson did't mention his name in his speech to the VFW today. The organization endorsed Reagan for president earlier this week. In a pep talk to supporters here later, however, Anderson noted Reagan's latest problems with China caused by his statements about Taiwan, saying: "He isn't even in the Oval Office and before he gets there he's precipitated his first international crisis."