Without wanting to put a downer on things I thought Tokyo was worryingly referred as 'The City waiting to die' given its location on 2 or 3 (?) major fault lines? Can't remember where I read that, but the implication was that it's only a matter if time before a massive earthquake irrevocably levels the place.
Japanese buildings are some of the most resilient in the world.
Tokyo hasn't been rocked by a devastating earthquake for some time (almost 100 years), during which time the technology has been substantially improved and tested by smaller quakes as well as the tremors of those from other prefectures.
However, other parts of the country have been hit by tragic earthquakes. But most of the fatalities of earthquakes in Japan come not buildings from collapsing, but the after effects such as landslides and tsunamis.
Focusing on the buildings – think back to the 2011 Tohoku earthquake. It was the third or fourth strongest earthquake in recorded history. Do you remember seeing the incoming tsunami? Almost all buildings were still standing, despite having been shook by a magnitude 9.1 earthquake just minutes prior. Many of these buildings would have been much older and less up-to-code than your average Tokyo building.
Due to Tokyo's topology and location, the city is less likely to be affected by either landslides or tsunamis, especially when compared to neighbouring prefectures. The reclaimed land of areas such as Odaiba may be the most vulnerable. But these locations are not as densely built-up or as populated as others (the cheap land is mostly used for refineries, storage, cargo, attractions, etc)
Not to mention, Japan has a very advanced earthquake detection system which provides precious seconds for citizens to switch off the gas, duck and cover, or jump out of an elevator (the exact latter having happened to me during a magnitude 5.0 quake just under a month ago).
Still, a magnitude 9.1 earthquake repeated in Tokyo would not be without significant structural damage. We likely would see some of the older buildings collapsing. Railways and roads will need rebuilding. But it would not be as tragic as an earthquake in a city elsewhere in the world (looking at you, Californian cities).