Cities or generally places with names (like streets) act differently than locations such as a cave or inside a tree or so.
Ich wohne in der Höhle (with dative) instead of "Ich wohne in die Höhle"
Ich wohne in New York instead of "Ich wohne im New York "
But if you refer to the city itself it becomes dative again.
Ich wohne in der Stadt New York (dative) instead of "Ich wohne in die Stadt New York"
I hope you understand the difference. You don't use articles when talking about names.
Correct. City names do not have an article, thus it is "in Hamburg". However, if you add an adjective, you als add the article. "Hamburg" may become "das schöne Hamburg", then you would say "Ich lebe im schönen Hamburg" with "im" being derived from "in dem".
Similar with country names as mentioned above. England -- in England; die Schweiz -- in der Schweiz; der Irak -- im Irak
However, if you want anyone to believe you, don't copy the Hochdeutsch accent of the computer voice! To hear how it sounds in Niederdeutsch, go here and click the speaker icon next to the simple "Hamburg" = Hamburg translation, and select the pronunciation from user "manimus". It sounds a bit like "Hum-boish" with a lateral lisp.