Yes, once it had seceded from the Union, Virginia didn't exist as a legal entity with any borders the Union was obligated to respect or any elected representatives the Union was obligated to recognize, so they were perfectly within their rights to instead recognize a Unionist government in exile as the legislature.
It went down a little different. It was never considered a foreign country. Secession was considered a null action; Virginia was still considered a legal entity with borders of the US with representatives to be respected and recognized. The “legislature” in Richmond had declared it was not bound by the US constitution, so had no standing in the eyes of Congress, but a small group of state legislators met in Wheeling (not really in exile as it was still within the state), swore allegiance to the state AND to the US constitution and nominated two gentleman to be seated as US Senators (at the time Senators in Virginia were not elected by popular vote but by the legislature); Congress accepted these two into the Senate thus legitimizing the legislature in Wheeling.