WASHINGTON (AP) _ A compromise designed to stave off exceptions to the nation's ''sodbuster'' soil erosion program won final approval Thursday from a unanimous House.

Under the bill, farmers who planted alfalfa on highly erodible land between 1981 and 1985 as part of an approved conservation plan would be allowed to grow a price-supported crop on it this year.

Without the legislation, a number of farmers with approved crop rotation plans for highly erodible land would have lost their federal subsidies if they planted the acreage in such commodities as wheat or corn.

The measure, hailed by conservationists, was passed last week by the Senate where it was fashioned by Sen. David Boren, D-Okla., as an alternative to legislation that had set off a month of fireworks.

The House gave unanimous consent to the measure, which was attached to a bill extending the deadline for a report from the National Commission on Dairy Policy from March 31 to the same date next year.

The House acted without discussion after Rep. Kika de la Garza, D-Texas, chairman of the House Agriculture Committee, endorsed the Senate compromise.

The measure now goes to President Reagan's desk.

Fireworks over the issue got under way following a March 4 meeting at which the Senate Agriculture Committee approved, without a hearing, legislation that would have granted an exception for alfalfa, grasses and certain legumes, or green vegetables, to ''sodbuster'' provisions of the farm program.

Under the sodbuster provisions, those who plant such crops as wheat and corn on highly erodible land lose their eligibility for the farm program.

Conservationists said the exception would have opened up hard-won provisions of the 1985 farm program which were designed to protect the nation's soil and wetlands. The Agriculture Department estimates that 6 billion tons of topsoil are eroded away as mud or dust each year.

Sen. William Armstrong, R-Colo., an early advocate of the ''sodbuster'' program, threatened a Senate-floor showdown unless the exception were deleted.