President Reagan's budget came under fire from two conservative Republican senators yesterday on grounds that it shortchanges mass transit and child nutrition.

Echoing complaints from more liberal lawmakers, Sen. Mark Andrews (R-N.D.) complained that the administration was looking only at the "dollar signs" in child nutrition, and Sen. Alfonse M. D'Amato (R-N.Y.) accused it of "thwart ing the will of Congress" in proposing to cut mass transit operating subsidies.

Their complaints, directed at Office of Management and Budget Director David A. Stockman during a Senate Appropriations Committee hearing, pointed up the difficulties that Reagan's latest retrenchment plan for domestic spending is having with conservatives as well as liberals.

Few of the complaints have been as harsh as those of Andrews and D'Amato, however.

Stockman attempted to strike a positive note at the start by stressing that the administration, in pursuing an overall "freeze" on domestic discretionary spending, was going along with many of Congress' smaller pet projects in order to get a united front on restraining growth of big benefit programs.

But, even as he spoke, D'Amato issued a withering statement attacking the administration's planned cutbacks in transit operating subsidies as "the most repulsive and blatant disregard for the will of the Congress in the entire budget proposal."

He said he and others agreed last year to support the nickel-a-gallon increase in the gasoline tax for highway and transit improvements only if the new revenue was used to supplement rather than supplant existing transit subsidies.

But instead, he said, "the amount available for operating assistance has been slashed by 69 percent" and "a footnote in the budget states that operating assistance will be completely eliminated in . . . 1985."

While New York City and other large metropolitan areas get less than 10 percent of their operating revenues from federal aid, medium and small cities rely more heavily on it, D'Amato said.

"I can tell you right now that if transit systems are forced to assume more cuts in operating assistance, our efforts to revitalize the economy, particularly in our urban centers, will be seriously hurt," he added.

"I wish you'd look at the defense budget a little more closely," D'Amato concluded.

When it was his turn to question Stockman, Andrews accused the administration of trying to squeeze child nutrition programs at a time of expanding need.

"Of all the dumb ways of saving money, not feeding kids is the dumbest," he said.

Stockman said the government is now spending $16 billion for feeding programs, compared with $1 billion in 1970, a five-fold increase even discounting for inflation. He added that the administration is proposing to retain current spending levels for school lunches and the maternal and infant feeding program while reducing and combining others, such as summer feeding, which he said has been "rocked with scandal."

This angered Andrews even more. He said he had visited poor areas of the District of Columbia and had found people scrounging for food in dumpsters. "After two years it's inexcusable we sit there and say there's no need--because the need is there," said Andrews. To argue otherwise is "a bunch of garbage and you know it," he added.

In response, Stockman said the federal government is financing 90 million meals a day, "an enormous amount," and added that if food isn't getting to the people, then "something's wrong with the programs."