When the city and county governments in Northern Virginia adopted their annual budgets earlier this month, they spent a lot of federal tax money.

In Alexandria, the City Council spent about $22 of U.S. revenue for every $100 of city and state funds. In Arlington, the County Board spent about $9 and in Fairfax County the Board of Supervisors spent about $6 in federal money for every $100 of county and state revenue.

These figures may be conservative, especially in Fairfax where they do not reflect the federal share of very high sewage treatment plant construction costs. But even at these levels, Federal aid to cities and counties is becoming a source of anxiety for many people in Washington and Richmond who worry about how the growing costs of state and local government will be financed in the future.

The foremost concern is that cities, counties and states that have increasingly relied on federal aid in recent years may soon be rudely thrown back on their own resources simply because the federal budget will not be able to tolerate continuation of the upward domestic aid trends.

Federal aid to cities and counties - creatures of the state governments - was almost nonexistent a generation ago. Last year, according to the U.S. Advisory Commission on Intergovernmental Relations (ACIR), the federal government laid out $40 in domestic aid for every $100 of state and local government spending.

F. John Shannon, assistant director of ACIR for taxation, pointed out in an interview that the $13 billion increase in domestic aid during the first year of the Carter administration was greater than the total program 10 years ago. It hit $72.5 billion that year. This year, it could rise to $81 billion, but that would be a decline in the recent rate of increase and perhaps a signal of a more severe slowdown in domestic aid in the near future.

"There is some reason to believe that the federal government will not be able to sustain the kind of geometric increases in domestic aid that we have seen in recent years," Shannon siad.

"In the first place, there are some new competitors for general federal revenues coming on the scene.One major source of competition for cities and counties may be social security. If the Congress has to turn to the general fund to finance some portion of social security benefits, then the mayors and governors may find themselves fighting it out with the lobbies for the elderly."

The local governments most dependent on federal aid are, of course, the big cities at the core of vast urban areas, the cities that the federal programs were designed to help. The ACIR recently published a selected list of 15 such cities, not including New York, that on average will get almost $50 of federal aid this year for every $100 of state and local money that is spent.

These cities are far more dependent on federal aid than are the suburbs of Northern Virginia. But it is remarkable that in those affluent suburbs, federal domestic aid, originally conceived to save blighted cities, has become such a significant factor.

One reason for this fallout of urban aid in the suburbs is the clout of suburban members of Congress, who now are organized into a suburban caucus. The price they extracted for their support of aid to the needy cities was a substantial amount of aid for their own, not-so-needy constituents.

As a result, if federal fiscal restraint or new competition for federal funds forces a slowdown in aid to the cities, the suburban governments, including those in Northern Virginia, also will share the pain.

This may not be an altogether bad thing. Some people believe domestic aid has been accompanied by a regretable substitution of federal government judgment for local decision making.

In his last message to the General Assembly, Virginia's conservative former governor Mills E. Godwin noted that one in six state employes were fully paid by the federal government and that federal grants to state agencies totaled almost $1 billion last year, more than one-fourth of the state budget.

"Because of the temptation (the grants) offer and their sheer number and constant proliferation, we find it extremely difficult to determine adequately the real need for many of them, or their influence on Virginia's initiative in determining her own priorities," he said.

It is, as Godwin added, a problem that merits "further study and evaluation."