It's possible to create your own settlement (or build off an existing one), you still have to worry about sustainability of it. Can the land support the population with resources (or maybe your guild makes a lot of money elsewhere and trades for everything they need, like a fortress). But as far as ultimate control of law and land goes, I imagine it would still be under the laws of the county\duchy\kingdom that the land 'belongs' to.
Perhaps you can make arrangements with the aristocracy\nobles toward your 'free city' goal. I imagine you would need to provide some sort of kickback in return... perhaps your guilds swords as a defensive measure (essentially becoming a barony\fort).