Mayor Marion Barry disclosed yesterday that he is considering "some small tax increases" along with spending cuts to help overcome an expected $28 million deficit in this year's District of Columbia budget.

Among the possible taxes, Barry said, might be a new sales tax on gasoline. He did not specify a tax rate, which would be applied to the pump price. The city now collects a gasoline tax of 10 cents on a gallon.

Barry also told reporters that after making up the $28 million gap, he expects to ask Congress for a supplemental appropriation that would use up the remaining $62 million of the authorized $300 million federal payment to the city for the current 1980 fiscal year. Congress already has appropriated $238 million as the federal contribution toward the basic city budget for the year.

But Sen. Patrick J. Leahy (D-Vt.), chairman of the District appropriations subcommittee, said in a Capitol Hill interview that Barry may be too optimistic. "I want to make sure they realize that with the mood up here, it is difficult to get any [supplemental] funds other than for a true emergency or as required by new [congressional] legislation," Leahy said.

Increased payroll and pension costs totaling about $35 million meet that test, Leahy said, but rising energy costs -- estimated by city officials at $3 million to $5 million -- may not unless the city can show it is economizing.

The imposition of new or higher taxes during the course of a fiscal year, as Barry spoke of, would be unusual if not unprecedented.

Ordinarily, the District decides each year whether higher taxes are needed to balance next year's budget. In this case, by contrast, the tax would be speedily imposed to provide more revenue to make up part of the shortage that was encountered in this fiscal year, which ends Dec. 30.

City officials, acting on orders the mayor said he approved, have submitted lists of possible economies that might be imposed to prevent a yearend deficit. If the cuts are inadequate to close the gap, he said the added revenue could then be sought.

Barry and Leahy said they talked by telephone late Wednesday after the disclosure of a letter in which the senator told the mayor his solution to the city's budget crunch would be "a test of your administration."

Both deplored that its contents had been made public.

Barry, asked if he resented the tone of Leahy's letter, replied, "of course." Leahy said, "I would never presume to scold the city -- the mayor is the only elected citywide leader, not me."

Barry replied to the senator with his own letter, which was hand delivered yesterday afternoon.

A source said the letter, described as friendly, expressed Barry's disappointment that the senator did not telephone to discuss the problem instead of writing.

Barry said his administration had discovered and was dealing with the problem, and it should not be seen as a "home rule" issue, the source reported.