Mayor Marion Barry, still struggling to cope with an apparently worsening budget squeeze in the District of Columbia, said yesterday that he will order a near-total freeze on city hiring next week.

The mayor also said he is considering imposing a new tax on services by professionals and such businesses as barber and beauticians.

Barry made the announcement as he emerged from a two-hour, closed-door meeting with members of the City Council, with whom he has been sparring heatedly for the past several weeks over the extent of the city's recently discovered financial problems and what should be done about them.

Less than a month ago, the mayor's office predicted a possible $28 million city budget deficit, but by last week he had revised that figure upward to as high as $84.5 million.

City Council member Betty Ann Kane (D-at large) said Thursday, however, that the deficit could actually be about $175 million. Yesterday, council member John A. Wilson (D-Ward 2) contended the figure could "be somewhere in the $250 million area."

Wilson, chairman of the council's finance and revenue committee, said his projection was based on what he termed new reports of city agencies spending at a rate that would exceed their budget allotments by Sept. 30, the end of the current fiscal year.

But Gladys W. Mack, the mayor's budget director, said Wilson's figures were inaccurate and taken out of context.

She acknowledged that some agencies are overspending but said she was confident that those expenditures would probably be reduced by Sept. 30.

Meanwhile yesterday, officials of the University of the District of Columbia said they are facing a $4.6 million budget gap in the current fiscal year.

As a result, school officials said they will have to impose a hiring freeze, and may cut back summer school programs.

While the mayor and council members have been unable to agree on the size of the fiscal gap, all agree generally that some form of new taxes may be necessary.

Yesterday the mayor talked about a possible new tax he said would "capture revenue" that is now untaxed on services provided by proffessionals as well as by other types of business. He did not provide detail, but Mack said it would in effect extend the existing retail sales tax to services at a rate not yet determined.

The present basic sales tax rate in 5 percent.

Barry mentioned taxing barbers, beauticians, architects, dentists, mechanical engineers, laundry services and some food services that are now untaxed.

Wilson said later that an increase in the real estate tax also was discussed at the meeting. An increase of one cent per $100 of assessed value would mean an increase of $1.4 million in city revenues, according to one mayoral aide.

Barry's plan to order a substantial freeze on new hiring would cut the city payroll by about 1,000 employes by Sept. 30. The city currently has 33,000 regular employes and about 13,000 others paid through federal grants.

The order, to be issued next week will set a target for cuts in each agency, and will bar new hiring until that agency meets its target. Exceptions will be granted only in vital cases such as the appointments of new department heads, she said.

Mack said the D.C. police department imposed its own freeze last November on hiring of uniformed officers to keep within its current budget.

Wilson accused the mayor of dragging his feet and not taking the budget problems seriously enough and said many of his colleagues on the council are lackadaisical on the issue.

Unless Barry cuts $126 million from the city's budget, Wilson said, his finance committee will not even consider tax increases proposed by the mayor. He contended the city could cut $120 million without layoffs.

The budget gap this year "could easily run over $200 million and running into next year could be a disaster," Wilson declared.

One new issue raised yesterday was a report of current budget overspending by city agencies. Wilson said this is running at the rate of $52 million a year, while Barry said the figure is much lower.

University of the District of Columbia spokesman John Britton said yesterday that the school's $4.6 million deficit was created primarily by rising costs for heating fuel and by the fact that the U.D.C. board of trustees had projected giving employes a 5.5 percent cost of living pay increase instead of the 7 percent recommended by President Carter and given to all D.C. government employes.

Britton said officials have not yet decided which "low-enrollment" classes will be dropped. The school expects to be able to handle the same number of summer school students -- around 5,000 -- as it did last year, he said.

U.D.C. officials have told Barry in a letter that they feel the school is unable to comply with the mayor's directive calling for $1.5 million in further cuts to help ease the city's overall budget crunch.

"Frankly, we think a new and developing institution should not be placed under the same restraints as other units," said Ronald H. Brown, chairman of the board of trustees. "We think we declare some special treatment."