Mayor Erias Lukwago said he collapsed after tear gas was thrown into his car.
Mr Lukwago is an opponent of President Yoweri Museveni, and government critics saw the incident as an attempt to stifle criticism of Mr Museveni.
Meanwhile, Ugandan opposition leader Kizza Besigye was arrested for holding an unsanctioned rally.
Mr Lukwago was due to appear before a tribunal on Thursday, for the first day of a hearing which could possibly impeach him for abuse of office.
According to the BBC's Catherine Byaruhanga, police surrounded his home and then escorted him towards the building where the tribunal was being held.
But on the way, a tear gas canister was thrown into his vehicle.
"All I could inhale was just the smoke - it went deep into my lungs. I have a problem of high blood pressure... I collapsed there. So they picked me, dumped me into the waiting van and drove away at a terrific speed," Mr Lukwago said in an interview with the BBC from his hospital bed.
He said that police officers hit him in the chest and tore his clothes.
"Those people were accusing me of all sorts of things - incitement to violence. They hit me in the chest, tore my shirt and treated me in a very rough manner," he said.
Kizza Besigye has been accused by police of inciting a crowd to rally in support of Mr Lukwago.
"We were surprised to see Besigye appear there. Then he started addressing and inciting people as usual, yet he had no police permission to do that," deputy police spokesman Patrick Onyango told Reuters.