D.C. Mayor Marion Barry, anticipating falling revenues from a slumping economy, announced yesterday that he has imposed tight spending restrictions on most city agencies and said some city services may have to be "modified" during this fiscal year.

"There's no way the District of Columbia can escape this recession," Barry said during his monthly press conference. Asked about possible service cuts, Barry replied, "I don't predict any cuts . . . . There may be some modifications in what will be done." Later, he added, "We may go back to several agencies to ask them to tighten their belts."

Philip M. Dearborn, a former financial adviser to the mayor and a vice president of the Greater Washington Research Center, said yesterday that Barry was effectively announcing an austerity program, and Barry's budget director, Gladys W. Mack, partially agreed.

"There's no question in my mind that things have been developing not as well as the mayor hoped they would," Dearborn said, adding, "He's not the only one who has been overly optimistic."

Mack, who described Dearborn's conclusion as "a fair statement," said an austerity program would be in effect at least for the next several months while the city assesses the stalled economy and awaits congressional approval of its budget for the 1983 fiscal year. By his actions, Mack said, Barry "is just being cautious."

But City Council member John A. Wilson (D-Ward 2), chairman of the Council's finance and revenue committee and a frequent critic of Barry on financial issues, said yesterday he was not surprised by Barry's actions.

"I told y'all six months ago, he was the only person in America who wasn't aware we were in a recession," said Wilson, who during his brief candidacy for mayor earlier this year contended that Barry's 1983 budget was geared toward his reelection instead of the economy.

"The important thing now," said Wilson, "is that they realize the conditions and are being candid about it. I told you it would be after the election." Mack declined to respond to Wilson's comments.

Barry discussed the budget at a wide-ranging monthly press conference at the District Building in which he also said the city finished the last fiscal year with a small budget surplus.

During the 45-minute session, Barry also defended his record high $1.2 million campaign for the Democratic nomination, which culminated in a victory in the Sept. 14 primary, and largely dismissed his Republican opponent in the Nov. 2 general election, Realtor E. Brooke Lee Jr.

"I haven't seen him. Is he running?" Barry joked with reporters. "What's his name, Lee Brooke?"

Financial matters dominated the press conference, however.

Although Congress has not yet passed the city's proposed $1.89 billion operating budget for the 1983 fiscal year, it did pass a routine continuing resolution that allows the city to spend at minimal spending levels approved by one house of Congress but not yet agreed to by the other.

Barry said, however, that only five agencies--the police and fire departments, the courts, Corrections Department and the school system -- have been allowed to spend at the minimal 1983 levels. The others have been told to spend at still lower 1982 levels, he said.

Barry also said yesterday that the city would show a budget surplus of about $6 million to $8 million for the fiscal year that ended Sept. 30, largely because of cuts of $8 million to $10 million ordered in agency spending. Total revenue was about $1.5 million below the amount orginally predicted for the year.

Finance and Revenue Director Carolyn L. Smith said after the press conference that the city's financial picture was improved by $4.5 million in revenues from the instant lottery game that began in late August. Those funds were not previously included in the financial forecasts for the 1982 fiscal year.

City Administrator Elijah B. Rogers said that the actual budget figures for fiscal year 1982 would not be released until next February, following an annual audit. He said any surplus would be used to lower the city's long term accumulated budget deficit, which is about $299 million.