A group of us once tried to rank cities in Europe by population only to realize that most of them are effectively incomparable.
Cities sometimes have clear legal boundaries that feel irrelevant to the question, like the City of London, but more generally have metro areas that sprawl well into an ambiguously defined countryside. There's rarely a "this block is city, the next block over is clearly not" situation, so the number of people you include ends up being pretty arbitrary.