The Virginia House of Delegates, in a dramatic contest between tax-cut advocates and supporters of Gov. John N. Dalton, narrowly defeated today a bill to partly repeal the state's controversial sales tax on food, but proponents quickly resurrected the measure for a final showdown tomorrow.

After the first prolonged and emotional floor debate of this year's session, the bill to eliminate half of the 4 percent tax gained a 50 to 47 majority, one vote short of the absolute majority necessary to pass a tax measure.

Tax-cut supporters, many of them Republicans who deserted Dalton, then narrowly won a parliamentary move to reconsider the bill and said they were confident they would pick up the votes needed to pass the measure tomorrow. Opponents promised a night of intense lobbying to thwart them.

"There are going to be a lot of broken arms overnight," predicted House Speaker A. L. Philpott, a leading foe of the bill, which is also opposed by the governor. Dalton, a Republican who champions Virginia's tradition for tight-fisted budgeting, contends that the state cannot afford to cut the tax and still maintain existing levels of state funding of schools and other services.

Proponents have argued that the state's estimated $201 million budget surplus and expected surpluses in future years would be more than enough to support current programs, as well as cover the food tax repeal. Under terms of the bill, the tax cut would not take effect until 1982 and would cost the state an estimated $110 million its first year.

"If I thought for one minute that we weren't going to have the funds available for these programs, like Medicaid and education, then I couldn't vote for this bill," said Del. Warren G. Stambaugh (D-Arlington), one of the leaders of the tax-cutting faction.

Voting on the measure cut across party lines, with many Democrats opposing the bill for fear it would harm the very underprivileged groups that they traditionally try to help.

Most of Northern Virginia's 19 delegates voted in favor of the partial food tax repeal, with only Fairfax Republicans Vincent F. Callahan, James H. Dillard, John H. Rust Jr. and Dorothy S. McDiarmid (D-Fairfax) recorded as opposing it. Del. Warren E. Barry (R-Fairfax) abstained, saying later that he opposed an amendment to the bill and had not believed his vote was crucial. Barry indicated that he will vote for the tax cut today.

House Finance Committee Chairman Archibald A. Campbell (D-Wythe), the bill's sponsor, said late today he expects to pick up at least two more votes before tomorrow's showdown -- those of William P. Robinson, Jr., a Norfolk Democrat who takes office tomorrow to succeed his late father, and Alexander B. McMurtrie, Jr. (D-Chesterfield), who was out of his seat during today's vote.

While many were predicting a heavy lobbying campaign by Dalton to defeat the bill, the governor's press secretary, Charles J. Davis III, said no such effort was planned. "The governor has made his view clear already and I don't anticipate any major effort," Davis said.

Some legislators who favored the tax cut said they were not about to change their minds overnight. "I want relief for all the people who provide the money to make the machine of government run," said Del. Clinton Miller (R-Shenandoah) in a spirited presentation on the House floor.