Ba Sing Se first shown in the Avatar series as an extremely secretive place, whether from the viewpoint of Iroh and Zuko in the Lower Ring, or with 'Team Avatar' surrounded by only the highest of the high in the Upper Ring.
While the the behavior of the 'Joo Dee(s)', the great fear of getting oneself in trouble with the goverement, the constant facade of being safe, and the mind tricks by Long Feng, I'm sure I'm not the only one who found obvious discomfort with what was actually going on in the walled city, many years ago when I first watched it. However, what became apperent to me first off was how much the social order and cultural aspects of Ba Sing Se matched those of Medival Japan.
Back in 1603, the concept of the 'Shogun' was first created by Tokugawa Ieyasu when he as a noble, appointed himself as a Shogun, and to this day was thought of a way to undercut the authority of the Emperor. With time the Emperor became a figure head (who could not be replaced as only those of the previous emperor's linegage were actually considered children of the Sun Goddess) but all affairs were actually only in the hands of the Shogun. Sound familiar?
My guess is, the concept of the Dai Li was derived from this social standing, later taken into plot with Team Avatar enlightening the Emperor who had never left his palace, and defeating Azula's coup d'etat.
Also along the lines of social standing, in the pyramid of heirarchy at the time held workers such as peasants, artisans, and merchants in that order. That's right, due to the idea of Confucianism at that had come from China long before, those who created resources were more important that those who just sold items made by others. In fact, sometimes merchants were actually made to live separated from the rest of the society due to thier standing.
Playing devil's advocate, holes can be poked in idea about how it is different due to the fact that other lower standing people also lived in the lower ring, and the fact that the rings are shown to only be separated by wealth, and merchants, while low in standing, still had quite a lot of money at their disposal due to their job still paying well. Regardless, I still find it that the fact of separated living space throughout the city could still have been based off of these facts.
Now, other than these similarities in just Ba Sing Se, it is reasonable to believe that most of the the Earth Kingdom is based off Imperial Japan, given that Avatar Kyoshi wore a Kimono and had makeup to match the standards of beauty at the time, (White face makeup with small red lipstick) not to mention that she lived on an island. While the actual world map for avatar does not corraborate the geographic features of the Japan, I'm sure that many aspects of the Earth Kingdom came from those of Japan.
EDIT: 3/30/16 Given that Avatar Kyoshi came from the Kyoshi Islands, it is possible that Japan (being an island) was just influencing that, not all of the Earth Kingdom, given that the Avatar world was known to take many influences throughout Asia. However, based on the great amount of evidence for Ba Sing Se and other places it is still given that Earth Culture was based off of Medival Japan.