i try to specialize my cities, particularly when i'm trying a warmongering game. i do mean trying, they don't come naturally to me. but in some circumstances i do build some stuff that isn't strictly "this building gives hammers so it's a no-brainer for a production center", etc. but i do try to always ask myself "how am i going to benefit by building this here?"
examples off the top of my not-quite awake head. keep in mind that i'm a permanoob not an expert, so
never do anything just because i recommend it! this is all
very situational based on available time/hammers/bodies to whip away.
if you're not running HR, or you can't keep the troops in your cities for whatever reason, markets can help with happiness there even if the city has no commerce. applies only if you have the resources that markets double (silk, ivory, whales, and fur). ditto for health with a grocer. i don't tend to have those market things really early, or guilds, but sometimes the timing works. more often, i'll build a forge in a city where i don't really intend to build with hammers, if i can afford the

and have gems/silver/gold. whipping counts the 25% bonus which is cool (cash-rushing doesn't).
in BtS, when i have the AP religion i really like to whip a temple for the +2

each, even if i don't need the happy from a temple yet. sometimes i'll even do a monastery when 10% science boost isn't much, if i'm a long way from SciM. it's
really nice to have that bonus production always there without having to feed a worker or specialist, and with no pollution negative like you'd get with a forge. in purely-food cities it can even be the difference between having 4 base hammers to benefit from OR and/or a forge in the first place

. the AP religion never changes so once that building is there i always benefit (except that monasteries only count until SciM).
sometimes i build a library for culture on the border even if the city isn't meant for commerce or doesn't have commerce yet. since i'm not a warmonger i don't usually rush to drama, but i do have writing as an option on crowded maps, so that works out. i prefer the AP buildings for that purpose tho, if i have the techs and the right religion.
those things are situational, and of course depend on whether you have the time and hammers to prepare that way. if your troops aren't able to be military police because they're going to be out fighting, chances are slim that you have time to whip out markets. but sometimes it works for me, depending on resources, since they're nice big whips to get rid of a few whiners and they'll be happy when they come back.
edit: see how not awake i am? i didn't even answer your question about what buildings every city should have. this was my attempt at "buildings some cities might benefit from even tho it's not what they're specializing in"
