The dairy lobby and friends in the House this week taught the administration a lesson in how to play politics in Washington--a lesson that might cost the administration hundreds of millions of dollars over the remainder of its term.

This was no routine event. The dairy lobby has humiliated the White House and raised the specter of a runaway farm program that could zoom through budget ceilings so important to President Reagan's economic program.

Such budget busting is not inevitable, probably not even likely. The Senate has passed a farm bill more to the administration's liking, and the House can reverse itself. But the White House is clearly on the defensive, largely because it failed to realize what was happening in the House the week before Wednesday's key vote on dairy price supports.

"We called and called to the White House," said an aide to the House GOP leadership, "but we didn't get through." Partly as a result, 104 Republicans voted against Reagan on the support. Now, when the House reconvenes next week, it may continue voting for agricultural price supports higher than Reagan wants.

Lobbyists and House members who shrewdly set up Wednesday's dairy vote hope for exactly that outcome. Their goal was to restore the farm bloc coalition that has historically backed the farm program--a coalition torn apart when the Senate acted on its version of the farm bill last month.

The key week began with a meeting Sept. 29 involving most of the Washington representatives of the big dairy cooperatives and the Milk Producers Federation. They devised a formula for milk price supports that would cost the government less than previous industry proposals, but more than the dairy program in the Senate farm bill, which is less generous to dairy farmers than any in modern times.

Apparently, the dairy industry had been pushed into this search for a compromise largely by friends of the tobacco industry. According to one Capitol Hill aide, members of Congress representing tobacco-growing areas had directly threatened colleagues friendly to dairy interests, saying the tobacco crowd would vote with the administration to keep dairy price supports down unless dairy's friends helped tobacco.

The dairy lobby knew it was in trouble, and such threats pushed it into action. A week ago Wednesday, industry representatives took their new plan to Rep. Tom Harkin (D-Iowa), chairman of the House dairy subcommittee. He liked the idea and convened a group of Democratic and Republican members of the House Agriculture Committee to discuss it. They liked it, too, and soon the new dairy proposal became "the cement" that stuck the old farm coalition together, as one dairy lobbyist put it.

The lobby's plan was to accept the Senate-passed formula for supports during fiscal '82, but to sweeten it for '83-4. The idea was to preserve today's price support level--$13.10 per hundredweight of milk--for another year. That represents 70 percent of parity, the pre-World War I farm price index. Then the support level would be allowed to rise to 72.5 percent of parity in 1983 and 1984.

According to the Agriculture Department, a 72.5 percent parity level in 1983 is likely to be about $14.57 per hundredweight, an 11 percent increase over the current price level. With that inducement, USDA officials fear, dairy farmers will not cut back their herds to reduce production, but wait for this '83 payoff. If this happened, huge mountains of government-owned surplus dairy products would continue to grow, and the dairy program would continue to cost a billion dollars or more each year.

With a plan in hand, the dairy crowd needed a tactic. They knew that Rep. Barney Frank (D-Mass.), a first-term liberal, planned to introduce the Senate plan endorsed by the administration, so Harkin and allies decided to counter with another amendment to restore the old support level, 75 percent of parity. Then they arranged for Rep. Berkley W. Bedell (D-Iowa) to introduce the dairy lobby's new plan as a "compromise" between "the extremes" of Frank and the old program.

This formula worked like a charm. Congressmen loyal to various agricultural commodities lined up behind the Bedell "compromise," obviously on the understanding that dairy friends who orchestrated the deal would line up for them later. Frank fought the administration's fight with energy and humor, quipping that he did not often expect to be allied with Reagan and Sen. Roger Jepsen (R-Iowa), author of the Senate milk plan. Agriculture officials just off the floor said the Massachusetts liberal was doing a great job. But the White House was never heard from.

Those in the leadership who wanted to support the administration's budget goals were pleading for formal word from the White House that it supported Frank. Calls were made all day, but no letter came. In the end, even the House Republican whip, Trent Lott (R-Miss.), voted against the administration position.

Yesterday, USDA officials realized what had happened, and began urgent efforts to try repairing the damage. They will have other chances to cut back the dairy program, but they have lost the initiative on the issue that last March was the subject of the new administration's first successful budget-cutting effort in Congress.