Democrats on the House Education and Labor Committee voted in caucus yesterday to abolish the entire impact aid program to stay within the stripped-down spending totals in the budget resolution Congress approved last month.

And Republicans on a House health subcommittee stalked out of the room as Democrats refused to merge 25 present programs into two block grants as proposed by President Reagan.

The two votes came as committees all across the Capitol met to bring programs into conformity with the budget resolution, as they are required to do by next week.

Impact aid, which goes to school districts serving children of federal employes, is one of the largest and politically most entrenched of aid-to-education programs. It cost $799 million last fiscal year.It is especially important to districts in the Washington, D.C., area.

The education and Labor Democrats, who are resisting the retrenchment in social programs proposed by President Reagan and ratified in last month's resolution, cast their vote yesterday partly as a way of driving home to members what the budget cuts will mean. It is also a way of shielding from cuts programs for the poor that the Democrats want even more to preserve.

Impact aid has been criticized in that much of it goes to relatively well-off districts, such as those in this area. "Impact aid is not the most defendable program. There is no relationship between need and ability to pay. dIf there is a choice, do you cut handi-capped education or impact aid?" Rep. Paul Simon (D-Ill.), one committee Democrat, asked yesterday.

The Education and Labor Committee has to vote some $12 billion in program cuts during the next two weeks. The impact aid vote was one of a number taken by the Democrats yesterday. Others were not disclosed. The Democrats will caucus again today.

The anti-block grant vote came in a House Commerce subcommittee on health.

"I'm being rolled," declared senior Republican Edward R. Madigan (Ill.) after efforts at a compromise on the block grant idea collapsed and he failed in an attempt to block voting on grounds a live guorum wasn't present. "I'm just going to leave and let them do the thing by themselves."

Although Chairman Henry A. Waxman (D-Calif.) insisted that the Democrats were cutting an average of 25 percent from the health programs as Reagan requested, Madigam said the Office of Management and Budget computed the cuts as less. He also said the OMB insisted that family planning, whose continuation was approved as a separate program in a 10-to-9 vote before Republicans walked out, be made part of a block grant.

Democrats contend block grants will give governors discretion to ignore some areas of vital need, and they oppose giving the states as much discretion as the president would.

Earlier yesterday, the Alan Guttmacher Institute, an advocate of family planning, announced that recent studies showed that in the 1970s at least 5.4 million unintended pregnancies were averted by family planning programs, at least 2.5 million of which would have resulted in abortions. The institute said that the $285 million spent by federal and state governments for family planning in 1980 had saved $570 million in government health and welfare expenditures that would have resulted from the pregnancies.

Waxman, endorsing the findings, called family planning "one of the great success stories" and Rep. James H. Scheuer (D-N.Y) said cutting back family planning would result in more abortions.

In other actions yesterday:

The Senate Veterans' Affairs Committee voted 11 to 1 to cut veterans' dental and burial benefits in order to stay within the budget resolution. Under the committee proposals, the $300 burial expense grant and the $150 burial plot grant would go only to veterans who were extremely poor or had a disability rated at 30 percent or more at the time of death. Under the dental plan, only veterans who had been on active duty for 180 days and who applied for benefits within six months (instead of the current 12 months) after discharge could get dental care.

The Senate Agriculture Committee voted to shift a series of costs from the Agriculture Department to farmers, also to comply with the budget resolution. The committee proposal would charge cotton, tobacco and grain farmers for federal inspections; require cotton and tobacco farmers to pay certain warehousing and grading fees now handled by the government; eliminate some grain storage loans and stop waiving interest on the first-year costs when a former stores grain in reserve.