The Virginia House of Delegates today narrowly approved cutting the state's 4 percent sales tax on food in half. Passage of the measure was seen as a sharp defeat for Gov. John N. Dalton and some of the legislature's leaders.

The measure, which would take effect in mid-1982, faces an uncertain fate in the Senate.

The 52-to-47 vote marked the first time in a decade that one of the state's legislative houses has agreed to repeal even a portion of the tax, which foes have said falls more heavily on the poor than any other Virginia tax. The measure, which also would provide $18-a-year state income tax credit for Virginians earning less than $20,000, now goes to the Senate Finance Committee, whose chairman, Sen. Edward E. Willey (D-Richmond), has vowed to kill it.

Willey, one of the Republican governor's chief legislative allies, would not repeat that promise today. But when asked about the bill's prospects, he replied, "I don't know but I've got a pretty good idea," implying it would die in his committee.

But the bill's Senate supporters would not concede the measure's death. "He [Willey] is a mighty powerful committee chairman but there are a lot of Democratic votes and a lot of Republican votes for this measure -- make no mistake about that," said Sen. Dudley Emick (D-Botetourt). He predicted "all kinds of intrigue" would take place before the bill's fate is decided.

Today's vote, which reversed an earlier one-vote defeat of the repeal measure, cut across party and ideological lines, with liberal Democrats such as Arlington's Warren Stambaugh and Mary Marshall joining some of the House's most conservative Republicans such as Fairfax County's John Buckley and Robert Harris in support of the bill. They argued that the state treasury, which this year has an estimated $201 million surplus, will have more than enough money to cover revenues lost under the bill. It is projected to cost about $110 million in 1982, when the repeal would become effective.

Tax-cut foes, led by House Speaker A.L. Philpott and Appropriations Chairman Richard M. Bagley, sided with the governor, who warned earlier this week that enactment of the bill would force deep cuts in state aid to local schools and other services that many lawmakers cherish. The opponents contended that many delegates supported the bill because they are up for reelection this fall and because they were confident that the Senate, whose members do not face reelection until 1983, would kill the bill.

"Probably at least half the votes for it were election-year votes," said Fairfax Del. Vincent F. Callahan, one of the GOP's senior House members and a repeal opponent.

Callahan was one of several legislators who criticized Dalton for not taking a more active role in pressing for the bill's defeat. The governor apparently made no effort between yesterday's narrow vote and today's to persuade individual lawmakers to support his stand.

"I'm disappointed that he didn't lobby on this," Callahan said. "I've supported him on all kinds of things. All he had to do was change a few votes."

The bill's sponsor, Del. Archilbald Campbell (D-Wythe), also called the vote a major setback for the governor. "He put himself in the middle of this fight . . . and he couldn't win," said Campbell. He and other tax-cut supporters noted that members of the governor's own party voted 14 to 11 in favor of the bill.

The governor's top aide, Secretary of Finance and Administration Charles B. Walker, disputed Campbell saying dalton was not necessarily opposed to the food tax cut, but had only pointed out "the consequences" of the bill. Dalton has said he probably would sign the bill, but many of his supporters believe he is counting on Willey and members of the finance committee to finish off the measure.

Many observers also expect the committee's Democratic leaders, which include Willey and Senate Majority Leader Hunter B. Andrews, to exact a political price from the Republican governor before they agree to kill the bill. If Dalton refuses to bargain, some believe the food-tax measure may pass the Senate.

The bill received a slim 50-to-47 majority yesterday, failing by one vote because Philpott ruled that as a tax measure, it needed 51 of the House's 100 votes for passage. After a flurry of parliamentary maneuvering, supporters managed to resurrect the bill for a final showdown today.

They picked up two votes from members who didn't vote yesterday, Dels. Warren Barry (R-Fairfax) and Alexander McMurtrie (D-Chesterfield) and got a third from William P. Robinson Jr., a Norfolk Democrat who was in today to succeed his late father. One member who had voted for the bill yesterday was absent from today's session.

Northern Virginians voted as they had previously on the issue, with only Fairfax Republicans Callahan, James H. Dillard, John H. Rust Jr., and Dorothy S. McDiarmid (D-Fairfax) of the 19-member House delegation opposing the repeal.