The controversial federal tobacco support program survived a historic challenge in the House yesterday, but the industry was put on notice that it must quickly change its ways or face brusque alterations.

Only an intensive last-minute lobbying campaign by tobacco legislators, enlisting the aid of House Democratic and Republican leaders and with a hand from the Reagan administration, saved the program from the same guillotine that crashed down on the sugar and peanut support programs last week.

The 231-to-184 vote against an amendment that would have wiped out the system of federal price supports and acreage and poundage controls came after a full afternoon of intense debate and a week of uphill struggle for tobacco-state legislators.

Tobacco's victory came with active support from House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) and House Minority Leader Robert H. Michel (R-Ill.), both of whom apparently heeded southern colleagues' warnings that votes against tobacco would be politically ominous for either party.

The architect of the tobacco turnaround, Rep. Charlie Rose (D-N.C.), frankly and frequently cautioned that Democrats would perish in the South if they went against the leaf. And, he stressed, Democratic loyalists owed North Carolina a favor. Its Democratic delegation voted heavily against the Reagan budget and tax-cutting legislation.

Rose and Larry J. Hopkins (R-Ky.), another leader of the tobacco coalition, conceded that yesterday's rescue effort could be a sort of agricultural last hurrah unless the industry accepts changes in the program.

"The vote today means that changes must occur," Rose said afterward. "The only blessing is that Congress has given us the chance to do it. If we dillydally, there'll be a lot of trouble."

Rose said that the Agriculture subcommittee he chairs will promptly schedule hearings to deal with major questions raised during the House debate.

Referring to last week's House votes against sugar and peanuts, Hopkins said that tobacco was saved from an identical fate only by flue-cured and burley members urging House leaders to postpone a vote on tobacco until this week.

"If this vote had occurred last Thursday," Hopkins said, "tobacco would have gone down the tube. We urged more time to allow cooler heads to prevail."

The object of their effort was the amendment offered by Reps. Robert N. Shamansky (D-Ohio) and Joel Pritchard (R-Wash.), who contended that the 48-year-old program wrongly enriches allotment holders and impairs exports by inflating prices.

Their assault, which last week seemed virtually certain to be incorporated into the pending House farm bill, ignited an old-fashioned debate that fired tempers and strained credulity while invoking appeals to fairness, patriotism and defense of the fabled small farmer.

Shamansky argued that the system of acreage allotments, that is, government franchises to grow tobacco, had created special privilege for wealthy landowners and institutions, who in turn lease the growing rights to farmers.

But, he added after yesterday's vote, "The basic factor is one of money. In North Carolina alone, there are 116,284 allotment holders but only 34,757 tobacco farmers. That means there are 82,000 doctors, lawyers, Duke Universities, and so forth, who get a bonanza that nobody in my district can enjoy."

Of Virginia's 10-member delegation, only G. William Whitehurst (R) voted for the Shamansky amendment. Maryland's delegation split, with Democrats Michael Barnes, Beverly B. Byron, Clarence D. Long and Barbara Mikulski voting in favor.

Tobacco defenders maintained that the program has been one of the least expensive of the commodity support schemes, largely because of the tight controls on production and prices that it establishes.

But, with regular increases in the federal price support and with more imported tobacco displacing domestic leaf, the government flue-cured warehouses have accumulated large amounts of mediocre tobacco that some experts believe will be unsalable because of price and quality, which could cost taxpayers over $500 million in the next few years.