The City of London IS part of the UK. But my understanding is that is has a special status, similar to Washington DC, so I believe it's technically not part of England, but is part of the UK, in the same way that some of the islands around Britain are not part of any of the 4 home countries but are part of the UK. This stems from the fact that the City of London was a seperate country in early English history when England was first consolidated, and then it eventually agreed to recognize the English king under the condition that it could keep a lot of its medieval political practices. The monarch asking permission to enter the City is one of the rights it got to keep.