I wish I could remember where I read this, it was years ago, but the assertion was that by the 23rd century in "Star Trek", travel on Earth and cross-cultural interactions would make the world so small that it would be a very homogenized planet. Accents and dialects would be fading away and eventually die out.
Except that as humans colonized other planets, they'd presumably develop new planetary accents. ST missed an opportunity -- they could've said, for instance, that Chekov came from a planet that was settled mainly by Russians.
I'm not convinced, though, that regular interaction and travel would cause regional accents to die out. You can find various different accents within a single city, where people who interact every day still speak differently from each other -- for instance, all the various gradations of London accents, from posh to Cockney and everywhere in between. Granted, there's a degree of class division underlying that, but there's more behind the existence of different accents than simply a lack of travel or interaction. There would certainly be more overlap of accents and cultures in an Earth united by transporters and high-speed shuttles, but certainly not to the point of complete homogeneity (and certainly not to the point of the uniform Americanized culture that Trek depicts).
Neat idea about what I guess would be "colonial accents" that came from colonization.
As far as "city" accents go, you're right. Even here in the DC area, you can still tell a native of Washington from someone who moved here or was brought up in the suburbs. It's getting hard, but you still can. That said, I honestly didn't realize how much my accent had changed over the years after living in NOVA twenty years before I went back to my home town in Iowa for an extended stay this year. I couldn't believe that's how I used to speak. It was actually "weird" to my ear. It was, you betcha.

Edited to add: I could also see colonies developing their own unique idioms.