Basic Social Security retirement benefits should not be immune in future rounds of budget cuts, Office of Management and Budget Director David A. Stockman suggested yesterday.

Stockman, testifying before the House Budget Committee about the Reagan administration's latest round of spending cuts and tax increases, said some Social Security recipients are getting "windfalls" because of past congressional mistakes in setting benefit formulas. He argued that it would not be unfair to change future benefits and to do so without having a decade-long phase-in period.

However, the OMB director made no proposal for cutting Social Security, and President Reagan has dropped an earlier recommendation for trimming benefits, especially for persons retiring before age 65. Reagan instead wants to name a 15-member task force to report early in 1983 on ways to insure the financial soundness of the Social Security system.

Stockman's comment about Social Security was just one of several in which he indicated that, except for the military, no part of the budget is exempt from the search for ways to bring federal spending in line with revenues. "The current budget outlook -- in the absence of further policy actions -- is for budget deficits of about $60 billion in each of the years 1982-1984," he warned.

Stockman said that quick passage of the $16 billion worth of spending cuts and tax increases proposed last week by Reagan is needed because of a "financial market crisis" and high interest rates due principally to huge Treasury borrowings caused by large budget deficits.

Questioned by committee Democrats what an "average citizen" should think at this point about Reagan's promises last winter not to make cuts in what the president called the "social safety net" programs, Stockman replied testily, "I would advise the average citizen not to take such statements as literally and as mechanically as you are in your questions."

The president never said that programs such as Aid to Families with Dependent Children, school lunch subsidies, food stamps, student loans and similar programs "cannot be reformed," he declared.

In the course of his often very blunt testimony, Stockman also turned aside criticism of proposed cuts in several other programs:

School lunches. It should not be necessary to continue subsidies for children of middle- and upper-income families to make sure lunches are available to poorer children, he said. Nutritionists who make that argument are being "uncreative." The present program is "grossly inefficient," and a way should be found to provide lunches for the needy "without spreading dollar bills across the countryside."

Medicare and Medicaid. "There are ample opportunities for running these programs more efficiently," Stockman said. In some states -- such as New York, where average Medicaid benefits annually are about $1,900 compared with only $700 in neighboring Pennsylvania -- "it appears too many people are hospitalized, too many people are institutionalized." Later he added, "We can save several billions out of Medicare without jeopardizing benefits for people who need it."

Welfare. Because of income "disregards" and excessive allowances for certain expenses such as child care or commuting costs, some welfare recipients have income not at the poverty level or just above, but $20,000 or $30,000 a year, Stockman said. Again, tighter limits and other reforms are in order, he indicated.

Amtrak. Congress decided earlier this year to increase the administration's requested subsidy for rail passenger service after Amtrak officials said the deep cuts proposed would have meant an end to all such service except in the Northeast Corridor from Washington to Boston. Asked about a renewed request for cuts, Stockman replied, "You can shut down Amtrak except in the northeast part of the country without any great loss. We're going to have to do it in a year or two anyway."

Energy conservation. Asked if it made sense to eliminate tax credits for insulation and weatherization expenditures or for solar heating while retaining the $1 billion break from the windfall profits tax on crude oil given some smaller royalty holders in the tax bill passed in August, the OMB director said it did not to him. "It doesn't seem to have any plausible economic rationale that I can see."

Highways. In light of the general condition of the nation's roads, it makes little long-term sense to cut investments in this area because they would return a stream of benefits to the public over many years, Stockman agreed. But, he added, "Our problem now is one of short-term instability" in financial markets that must be resolved.

Stockman maintained that with a comprehensive reexamination of virtually all federal spending programs, the budget can be balanced in 1984 as Reagan has promised. It is up to the legislators to decide exactly which reductions to make and what strategy to use to enact them. "We are interested in the bottom line," not the details, the director said