The annual tug-of-war between Congress and the District government over the federal payment -- the U.S. government's annual contribution to the city's budget -- may end this year with the adoption of a standard formula to determine the amount.

President Carter, in last night's State of the Union message, pledged that his administration will work toward "development of a sensible formula" for getting the payment. Both the federal Office of Management and Budget (OMB) and the District's budget office are backing formulas that would give the city a set percentage of the money it raises through local taxes.

OMB and the city are far apart, however, on the size of the percentage. OMB favors 31 percent, which would amount to $301 million in the fiscal year that begins in October, while the city wants 45 percent, which would come to $365 million. The payment for fiscal 1980, approved by Congress last summer, is $238.2 million.

Even if OMB and the city reach a compromise, the idea of tying the payment to locally generated tax revenues faces opposition in Congress from at least one key committee chairman.

Rep. Charles Wilson (D-Tex.), chairman of the House Appropiation District subcommittee, said yesterday, "I don't like the idea of a formula, at least until the city cuts down on the number of [municipal] employes. I might go along when the employe-to-resident ratio is within the same range as other cities."

An aide to House District Committee Chairman Ronald V. Dellums (D-Calif) said the formula is "one rational way" to fix the payment. But he said committee staffers are also "looking at other ways to calculate it, because whatever we come up with must be logical to members of Congress."

Setting a regular formula for the federal payment would remove one of the last major obstacles to full home rule for residents of what some call the nation's "last colony." "(Other major hurdles include autonomy over the budget, now subject to line-item scrutiny by Congress and veto by the president, and clarification of Congress' power to veto legislation passed by the City Council.)

The District's staunchest supporters on the Hill -- including Dellums and most of his committee -- reportedly have made a political judgement that the fixed payment, whatever formula is used, initially must be in the range of $300 million, the maximum now provided in a multiyear authorization act.

When limited home rule was instituted seven years ago. Congress was required to set federal payment authorizations for mulityear periods, giving the fledgling city government some idea of how much it could expect from the U.S. government over time. The payment is designed to make up for tax dollars the city cannot collect for federal property and for expenses the city incures as the nation's capital, beyond the benefits it receives as the seat of government.

Although the current authorization is set at $300 million, in practice Congress has appropriated less than that each year. The $238.2 million payment for fiscal 1980 amounts to 17.2 percent of the District's $1.384 billion operating budget, the smallest percentage in 14 years.

The formula idea is not new. For 90 years, between 1835 and 1925, the payment was set at between 40 percent and 50 percent of the District's budget. But the budget was also controlled by Congress, which viewed the District as just another federal agency.

Last fall, the city tried to justify an increased federal payment in a 53-page document prepared by the office of District Budget Directo Gladys W. Mack.

It pointed out that the city cannot impose a single penny's worth of taxes on its largest landowner, the federal government, which occupies 31.1 percent of the real estate in the District.Neither can the city tax any of the nonresidents who make up two-thirds of the 577,600 workers in the city.

The document lists restrictions totaling $551.6 million that it contends are imposed annually by the federal government, including a large number of police and firefighters required to protect federal buildings and personnel.

The city contends that it is the large number of public safety personnel, rather than the payroll padding implied by Rep. Wilson, that accounts for the large number of municipal workers here. The District has 14,171 employes in its departments of police, fire, sewers, sanitation, parks, highways and general administration compared with 12,508 in Balitmore; 6,101 in Atlanta; 8,357 in Boston; 4,131 in Buffalo, 9,267 in Houston; 6,631 in Milwaukee; 6,521 in St. Louis and 8,592 in San Francisco, cities of roughly comparable population.