Top District of Columbia officials and their allies in Congress counterattacked yesterday against a State Department proposal that would strip the city government of any control over the location of foreign chanceries.

Mayor Marion Barry, City Council Chairman Arrington Dixon, council member Polly Shackleton (D-Ward 3) and Zoning Commission Chairman Walter B. Lewis, all testifying separately before the House District Committee, called the State Department position an affront to the city's hard-won, six-year-old home rule powers.

But the harshest opposition to the proposal came from the lawmaker who conducted yesterday's six-hour hearing, Rep. Ronald V. Dellums (D-Calif.), the District Committee chairman. Dellums protested the State Department tactic of persuading the House Foreign Affairs Committee in April to include the provision, which would override city zoning, in a pending national bill authorizing a variety of federal diplomatic functions.

The decision-making power over the location of chanceries, as foreign embassy offices are called, would be transferred from the city's two zoning panels to the National Capital Planning Commission (NCPC), a federal body with a membership of federal and District representatives. Although the NCPC membership is split on the proposal and has taken no official stand, its chairman, Helen M. Scharf, testified yesterday that she favors it.

"I get the uncanny feeling," Dellums told the State Department's acting legal adviser and principal witness, James H. Michel, "that an end run was done around this committee, adding later: "This is a local home-rule issue . . . a legitimate concern" of local residents.

"What I detect," observed freshman Rep. Mervyn M. Dymally (D), a former lieutenant governor of California, "is an old State Department colonial attitude toward the District."

During the more than an hour in the witness chair, Michel testified that the District government is not responsive enough to the need for locating chancery sites.

The issue came before the District Committee because Dellums persuaded House officials to let his panel review the Foreign Affairs Committee's proposed legislation before the full House acts. On June 10, when the District Committee meets to adopt its position, it will consider two proposals by Dellums to kill the transfer of zoning pwoer to NCPC or, as a compromise, to permit NCPC to override city rejections of chancery appliactions.