NYC is a pretty big city (the biggest in the US) and the NYC mayor is one of the more important positions in US politics. They have been household names for quite some time. Giuliani was a household name before Trump because of this. After 9/11 he was even called "America's Mayor." de Blasio is often on the news and Bloomberg used to be.