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.
While it is arbitrary, and not a city (in the sense that it hasn't received that status from the Queen), Greater London is absolutely a defined administrative area in the UK, with a governing body (the London Assembly) and a mayor (the Mayor of London -- not the Lord Mayor of London, who is the mayor of the City of London).
Anything can be ranked as long as you clearly define the ranking metric first.
When ranking by population it often makes most sense to use the population of the metropolitan area. That is, to ignore the administrative divisions, which vary too much, and focus on the physical reality of the urban area.
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.