William G. Thomas of Alexandria is known in Richmond as Virginia's "deputy governor" because of his close ties to Gov. Charles S. Robb and his skills as a lobbyist.

So last week when officials in Virginia Beach, the state's largest city, decided to seek more highway monies from the General Assembly, it was only natural, city officials say, that they should turn to Thomas.

The City Council agreed unanimously to pay him $20,000 to lobby the legislature next year.

But that was before they realized that Thomas also represents the Northern Virginia Builders Association, a group whose legislative agenda has not been the same as many of Virginia's local governments.

After the disclosure, several Virginia Beach council members said it would be foolish for the city to hire Thomas to work for the city while at the same time he may be opposing efforts by the state's localities to force developers to share in the costs of building roads to new housing developments and commercial projects.

Virginia Beach Mayor Harold Heischober said yesterday that the city is caught in "an awkward situation," and the council will decide this week whether to scuttle its agreement with Thomas.

"The truth is, we're desperate on this road-funding thing," said Virginia Beach Vice Mayor Reba S. McClanan.

Thomas said yesterday that he has a meeting scheduled with Virginia Beach officials today "to talk about what the issues are and what we can do to help them." He said he was unaware of the controversy about his selection.

"I have told them that we can't lobby" on this highway issue because it is not one that lends itself to persuasion, he said. Thomas said most legislators will follow the wishes of their jurisdictions in voting on any legislation that would change the state's highway funding formulas.

"We might be able to help with strategy" for winning support of a highway funding bill, said Thomas. He said he has not set a $20,000 fee and would bill Virginia Beach on an hourly basis for his lobbying.

Some of Virginia Beach's legislators told city officials they view the City Council's decision to hire Thomas as an infringement on their turf and a waste of taxpayers' money. But city officials are unconvinced.

"If they are doing such a good job, why are we so far behind the eight ball?" councilman H. Jack Jennings said.

State Del. Glenn B. McClanan, husband of the vice mayor, is one of the few legislators from Virginia Beach who said he would welcome Thomas' assistance. "I don't think that's a major concern" that Thomas represents the Northern Virginia builders, he said.

"Anybody who thinks that is a conflict doesn't understand the adversarial system and lawyers," he said, noting that lawyers often represent one client in a certain case and a rival client in another case.

Thomas pointed out that the Northern Virginia Builders Association supports the highway formula changes advocated by Fairfax and Virginia Beach.

For the past several years, state legislators from Northern Virginia, Virginia Beach, suburban Richmond and other rapidly growing areas have been trying to get the General Assembly to revise the formula for allocating state highway money.

The legislative leadership has promised to take up the issue during the 1985 session, and a legislative task force is currently drawing up proposed changes.

Under one proposal, all the areas of rapid growth would get millions of dollars more in highway funds. Areas that would lose the funds are expected to fight any revision of the funding rules.