Virginia's House of Delegates, in a rare tax-cutting mood, today gave preliminary approval to repeal of the state sales tax on nonprescription drugs and revived slim hopes for repeal of the hotly debated same 4 percent tax on food.

Meanwhile, the future of Gov. John N. Dalton's proposed four-cent-per-gallon increase in gasoline taxes appeared bleak after a House Finance subcommittee voted unanimously late last night to recommend against the proposal. Its defeat would be a major political blow to the Republican governor, who has staked his prestige on the issue.

The bill to repeal the nonprescription drug tax was originally a companion to a measure repealing the 4 percent sales tax on food. But when the food tax repeal was scrapped by the House Finance Committee, many lawmakers threw their support to the less significant drug tax bill, which passed the House today 63 to 28.

The bill, which is expected to gain final House approval Friday and then go to the Senate, would take effect in 1982 and save Virginia consumers at least $6 to $7 million in state taxes its first year. By contrast, the gradual phasing out of the food tax would save more than $50 million its first year and would by 1985 cause an annual decreased in state revenues of $244 million.

After passing the drug tax repeal, lawmakers voted by 51 to 42 to reconsider their vote yesterday to defeat a bill that would give tax credits to low-income families for their food tax payments.

Some legislators has said they opposed the tax credit bill but favored repeal of the entire tax.

Yesterday's vote set off an evening of legislative maneuvering among lawmakers favoring repeal.Their plan was to revive the tax credit bill, amend it to call for full rrepeal of the tax, and then have a floor vote on repeal. It would have been the first time that either branch of the General Assembly had ever voted on repeal of the tax, which polls have long shown to be the most unpopular tax in Virginia.

But Del. Archibald A. Campbell (D-Wythe), the Finance Committee's chairman, charged that the efforts were an attempt to bypass his committee and flew against longstanding legislative tradition.

The House approved a motion to reconsider the bill 51 to 42, then even more narrowly -- by 46 to 44 -- approved a motion to move the bill back in the calendar to allow it to be amended. But then the lawmakers voted 63 to 42 to send it back to Campbell's committee.

The bill's chief sponsor, Del. Warren G. Stambaugh (D-Arlington) said he agreed to send the measure back to the committee because he lacked the votes to pass it. He said he would try again to convince the committee to okay repeal of the food tax.

Campbell and influential House Speaker A. L. Philpott both said they doubted the committee would prove to be more flexible.

"These people still have not told us where to get the revenues to replace those lost by this bill," said Philpott. "It's irresponsible."

A Campbell-appointed four-member subcommittee voted unanimously last night against the Dalton tax plan, which would pay for highway and Metro construction. Members said they wanted State Highway Department expenditures closely studied for one year before they approved any tax increase.

"The roads are going to hell and they want to cop out for a year," complained Del. Vincent F. Callahan Jr. (R-Fairfax), sponsor of the Dalton bill. Callahan said chances for its approval by the full finance committee "don't look very good."

The full Finance Committee will hear testimony on the Dalton bill tomorrow and may vote on the proposal then.

Dalton press aide Paul G. Edwards said today he still believed the committee may approve a compromise 2 or 3 cents per gallon increase in the gasoline tax, but conceded "Perhaps I'm just totally quixotic."