If I am talking about a particular place/city, should I be asking
“Gibt es einen Supermarkt?”
“Hat es einen Supermarkt?”
What is the difference between the two? A formal explanation of when to use es gibt and es hat would be really nice.
Gibt es [a certain facility]? is standard German and hence universally correct.
Phrasing the question as Hat es …? is a dialect variant that I would expect to hear in southern areas.
Edit after reading comments:
Taking into account the above dialect varieties of geben/haben, in southern areas:
Gibt es Fisch?
asks whether fish is on the menu (generally or today), but not necessarily signals your intent to buy some (implicitly, yes …)
Hat es Fisch?
asks whether a serving of fish can be ordered or bought right now.
The only important difference is a regional one. As a non-native speaker who does not target a specific region, always use es gibt. In Switzerland, and if you want also colloquially in the south-west of Germany, you may want to prefer es hat. See here for a distribution map. Both versions are understood everywhere, but es gibt is the supraregional standard.
Es hat probably derives from a calque of French il y a. At least this would explain its distribution.
Regarding the meaning: Es hat has no more to do with having than es gibt has to do with giving. Both expressions just mean there is/are with no special connotations. (The same applies to French il y a.) Unlike English, where you can make the word there in there is revert to its original meaning by stressing it, not even stressing gibt or hat has any effect beyond stressing the existence of something. (Nobody ever stresses es except when correcting a misunderstanding after someone misheard the word.)
In regions in which both variants are in use, naturally es hat is more common in colloquial speech and es gibt is more common in somewhat elevated registers. This easily explains the distinction that Stephie added in a post scriptum after some commenters pointed it out: In a philosophical treatise, it’s always “es gibt”, but when talking about the fridge content in those regions it’s always “es hat”. General existence of something in a shop or on a menu is an intermediate case that will be handled differently depending on where you are located on the “es gibt”—“es hat” dialect continuum. (Unfortunately the discussion was confusing because the more special haben Sie was also considered.)