For the first time in several years, House and Senate Democrats today deadlocked over the nomination of a judge to the Virginia Supreme Court, creating the possibility that the legislature would forfeit the politically sensitive appointment to Gov. Charles S. Robb.

The two party caucuses split when Senate Democrats nominated Chesapeake Judge William H. Hodges, a former Tidewater legislator with allies among conservatives, after their House counterparts backed Richmond Judge Marvin H. Cole.

That opens the way for intensive lobbying during the final days of the session in a fight that divides along geographical and philosphical lines. Virginia judgeships usually are decided in the Democratic caucuses, which blind the legislators to vote as a bloc. If the General Assembly adjourns Saturday without a nominee for the Supreme Court vacancy, the decision would then fall to Robb.

The House acted in the morning, over the objections of Hodges' supporters who had wanted the caucus votes to be held simultaneously. When caucus chairman Del. Alson Smith Jr. (D-Winchester) wouldn't postpone the balloting, Hodges' name was withdrawn in the House, giving Cole an overwhelming vote.

In the Senate, the vote this afternoon was much closer. A majority of senators from southwest Virginia tilted to the Hodges camp, according to Senate caucus chairman Clive L. DuVal 2nd (D-Fairfax). "Enough of them voted together to make the difference for Hodges,"he said.

The vote in the Senate apparently disrupted an alliance among Northern Virginia and the mountainous Southwest--and more recently, the Richmond area--which began in 1982 with the election of Judge Roscoe Stevenson of Covington to the state's top court.

The northern-southwestern alliance held firm last year when Arlington Judge Charles S. Russell was put on the Supreme Court. In 1982, the Richmond contingent threw its votes to Russell, with the understanding that at the next vacancy, they would get reciprocal support from Northern Virginia and southwest.

This year, after Supreme Court Judge W. Carrington Thompson announced his retirement, Hodges and Cole emerged as the main contenders.

Northern Virginia was solidly in support of Cole, following the understanding reached last year. He was also endorsed in the Democratic caucus by Sens. Edward E. Willey of Richmond and William Parkerson of Henrico, which blurred Hodges' support among Senate conservatives.

Although lobbyists for the two judges--both Hodges and Cole are now on the Circuit court--said they will keep lobbying in both houses, DuVal predicted that the deadlock won't break before the General Assembly adjourns Saturday.