The House yesterday narrowly defeated an effort to kill a clean air program requiring anuual inspections of the pollution equipment on automobiles in 37 areas across the country, including the D.C. area.

The vote, on an amendment by California Republican William E. Dannemeyer to the Environmental Protection Agency's appropriation bill, was 184 to 177.

It was one of the first of what promises to be many tests of strength on clean air legislation in this Congress.

The 1970 Clean Air Act, which made automobile makers clean up their cars and also required state inspections to make sure the cleanup equipment works, expires this year. Congressional opponents, spurred by industry complaints, are gearing up to challenge key parts of the act.

Dannemeyer, whose southern California district is one of the nation's smoggiest, said 37 percent of the smog in his district comes from autombiles and the rest from industrial plants and natural sources such as vegetation. He predicted that with an $11 inspection fee and a high cost of repairing pollution equipment, EPA's inspection program would cost Californians $210 million a year.

Rep. Stanford E. Parris (R-Va.), noting that Northern Virginia is due to begin pollution equipment inspections this January, called the program an "unnecessary expense" and "an inconvenience" to constituents.

The District and Prince George's, Montgomery and Baltimore counties are to begin inspections by January, 1983. They are among 37 particularly polluted areas covered by the program in 29 states.

Barbara A. Mikulski (M-Md.) called the Dannemeyer amendment "a backhanded, backdoor action," "a piecemel dismantling" and "an irresponsible weakening" of the Clean Air Act.

California Democrat Henry A. Waxman noted that, although 1981 cars are supposed to emit 90 percent less pollution than earlier models, the equipment is often ineffective because consumers don't keep their cars tuned or they illegally use leaded gasoline and tamper with the equipment. Carbon monoxide, which aggravates heart disease, and hydrocarbons, which can lead to asthma attacks, are major automobile pollutants.

Among local representatives, Maryland Democrats Michael D. Barnes and Steny Hoyer voted against the amendment; Marjorie S. Holt (R-Md.) did not vote; Virginia Republicans Parris and Frank R.Wolf voted in favor.

In other action, the House passed 202 to 162 an amendment to the Housing and Urban Development appropriations bill cutting $10 million of $30 million slated for HUD's policy development and research office.

Rep. Robin L. Beard (R-Tenn.), the amendment's sponsor, noted that the office, which dispenses consultant grants for academic studies, had spent 23 percent of its 1979 money during the last week of the fiscal year and 35 percent of its 1980 money during the last month of the fiscal year -- proof, he said, that the office was "greatly overfunded."

Beard and Parris read lists of grants that they called "social pork barrel" and "frivolous spending," including $100,000 for a movie on "how, why and where people make use of public places" in New York City; $139,000 for a study on "how upset people get filling out government forms which as the same questions repeatedly," and $92,000 for the National Association of Homebuilders to collect data on the home-building industry.

The House is expected to complete action Tuesday on the $63.3 billion 1982 appropriations bill for HUD, EPA, the Veterans' Administration and 18 other independent agencies.The bill represents a 10 percent cut from fiscal 1981 funding, and cuts $1 billion out of rent supplement payments for low and moderate income tenants.