Bonus question: If no to the main question, when did the idea of the "Thieves Guild" become popular in media?
I'm not an expert by any means, but both answers so far have looked at early fiction rather than reality
Thieves Guild's do seem to be more a fictional occurrence than based in reality, however I have found at least one source that argues that there have been examples, the major problem I've seen is that because they were "unofficial" guilds, the literature tends to brush over them. At least from what I can research right now, there may be better literature on the subject in my university library (which I can't get to right now)
Anyway in The Islamic Guilds by Bernard Lewis you have this paragraph
There remains to be mentioned one very curious phenomenon in Muslim guild life-that of what are known as the immoral guilds. From the earliest times we find, in Muslim lands, organised guilds, complete with ceremonial, code and rites, of such " professions " as thief, brigand and bandit. The Banu Sasan, or organised bandits of Cairo, long exercised considerable power, and during the period of disorders under the Abbasid Caliph al-Muqtafi, the thieves' guilds of Baghdad seem to have dominated the town. These organisations, which, needless to say, had no real contact with the true artisans' guilds, nevertheless served to bring the latter into disrepute, and were often used by anti-guild polemists as a means of attack.
This suggests that there were certain guilds for immoral purposes, and in the case of Baghdad, thieving is included. However this brief mention is all I could find of it, however I have found this sort of guild backed up by a look at Turkish guilds in a similar period.
Entertainers of all kinds and members of the so-called 'immoral guilds', such as prostitutes, pickpockets, etc. The fact that these guilds do not generally figure in documents on the guilds' administrative, economic or social functions does not mean that they did not exist.
This comes from Gabriel Baer's The Administrative, Economic and Social Functions of Turkish Guilds. Whilst it's talking about Turkey, rather than Baghdad in this sense we can see the Middle Eastern / Muslim populations forming guilds much more spontaneously than their European contemporaries who were much stricter with rules allowed for these "immoral guilds" to flourish.
Whilst this isn't thieving, the biggest example of an "immoral guild" in Middle Eastern society could be seen to be the Assassin's from the Middle East, the group led by Hassan-i Sabbath, probably their most famous hit (although unsuccessful) would have been against Edward Longshanks / Edward I
Sources
Baer, G. (1970). The administrative, economic and social functions of Turkish guilds. International Journal of Middle East Studies, 1(01), 28-50.
Lewis, B. (1937). THE ISLAMIC GUILDS. The economic history review, 8(1), 20-37.
The idea of "Thieves Guilds" is not a new idea and did occur many times in history. Secret Societies and mafia like organizations can be found in many places in and in many periods. I specialize in Chinese history, and can answer your question in this context. For a great novel on a Chinese "Thieves Guild" read the Water Margin you can buy the best translation here The original was written in the Ming Dynasty about a group of loyal bandits who go together to form a Robin Hood style band. The idea of a "Robin Hood" band of bandits is not new, and forms the basis of a thieves guild found in many fantasy stories. Secret Societies often were an outgrowth of increased discontent or a way to bring order where centralized rule was lacking. The stories associated reflect real organizations. In China these societies included the Heaven and Earth Society, The Elder Brotherhood society, and can be traced many Rebellions such as the White Lotus Rebellion, Yellow Scarfs Rebellion, and many others. The "Guilds" or secret societies therefore played large roles in bandit organization which could lead to the overthrow of a local leadership.
How would you define a thieves guild? Wouldn't piracy fall within that definition?
No sources, but I would like to ask a possibly clarifying/tangential/related or follow-up question that may be easier to source.
I've read that ever since there have been cities there have been better and worse parts of town, and "cracks" where certain types of "unsavory" characters gather, from homeless kids who gather where they can find a roof near a factory that vents warmer air in the winter to modern pedophiles camping under the Biscayne Bay bridge. Is this idea also largely fictional? Might these "guilds" in some cases be fictionalizations based on known "gathering spots"? (For example, is there any evidence of historical Artful Dodgers gathering dupes under them that may have inspired Dickens' tale?) If these places existed, where they unintentional governmental mistakes, like the Miami bridge, or directly, intentionally created to fence in the marginalized?
Banditry "gangs" are about the closest thing to a guild (in the sense that they were organized, but they were not lasting organizations)
A decent example would be that of the Coterel and Folville gangs of England (who gave rise to legend of Robin Hood I believe) http://catterall.net/RH/Coterel.html
This is slightly off topic, but I would like to add a follow up question.
How prominent were "secret" guilds such as the Illuminati?