The District of Columbia, Maryland and Virginia will reap millions of dollars from the nickel-a-gallon federal gasoline tax increase approved yesterday by the U.S. Senate -- money that will be used to resurface huge portions of the Capital Beltway, improve some of the District's dilapidated major thoroughfares and modernize its outmoded traffic-signal system, according to area officials.

Washington's Metro will also gain significantly from the bill, which for the first time sets aside a special fund for transit around the country, using 1 cent of every nickel collected from the tax. The money could be used to hold down future fare increases or to reduce Metro's dependence on payments from local governments.

The District and all 50 states contribute gas tax revenues--nine cents a gallon under the new bill -- to make up the Highway Trust Fund. The money is then passed out among them under various formulas.

One of the big winners in the legislative battle last week was the District, which won three major concessions as the House and Senate went to conference to reconcile their differences over the measure that will fund highway construction and repair for the next four years.

The District won a guaranteed floor of $10 million for repair of "primary roads" in the coming fiscal year, although under an earlier version of the bill it would have received only $3 million. The District got $1.8 million this year for repairs, according to Thomas Downs, director of the the district's Department of Transportation.

The District will now be able to turn its attention to repairs on roads and bridges suffering from years of neglect, including South Capitol Street and New York Avenue, Downs said. Also, the District will be able to use about $32 million to build a parking facility at the future Anacostia Metro stop. An amendment, shepherded through by Sen. David F. Durenberger (R-Minn.) changed existing law so that four cities--the District, Baltimore, Minneapolis and Miami--would be allowed to use federal interstate highway funds for public transit purposes. The Baltimore facility will be built at a future subway stop in Owings Mills, in Baltimore County, according to congressional aides.

The District will get $64 million from the Highway Trust Fund in fiscal 1983. On top of that, the measure calls for federal funding from other sources at $35 million to modernize the city's traffic signal system, according to Downs.

The city's 1,300 traffic lights are run by a 25-year-old computer, and the system breaks down when it "gets wet outside, cold outside or hot outside," according to Downs, who hopes to have a new system under construction by the summer of 1983.

Under the new bill, Maryland would receive $332.4 million in fiscal 1983, about 24 percent more than it got from the fund last year.

"It will allow us to start resurfacing and rehabbing the entire Capital Beltway from Georgia Avenue, through Prince George's County, to the Woodrow Wilson Bridge," said Highway Administrator Slade Caltrider.

Maryland's share of the fund will rise to $387.3 million in 1986. Maryland's share is exceeded by only a few states, because the money is apportioned in part on the basis of interstate highways under construction. Maryland is building an expensive second tunnel under the Baltimore harbor on I-95.

Virginia would receive about $267.4 million in the current fiscal year, about 28 percent more than it got last year; that would rise to $316.9 million in fiscal 1986. Projects under construction in Virginia include the widening of I-95 between Fredericksburg and Ashland and work on I-64 near Newport News, according to state officials.

The bill will provide money for a future project to improve U.S. Rte. 1 between Reed Avenue in Alexandria and S. Glebe Road in Arlington, according to a aide of for Rep. Frank Wolf (R-Va.)

Virginia Sens. John W. Warner (R) and Harry F. Byrd Jr. (I) and Maryland Sen. Charles McC. Mathias Jr. (R) voted in favor of the bill. Sen. Paul S. Sarbanes (D-Md.), despite heavy lobbying in favor of the bill by Maryland Transportation Secretary Lowell Bridwell, voted against it. He said later that the tax was another part of President Reagan's "policy of trying to put a greater tax burden on the working people . . . while giving very large tax breaks to the wealthy."