Among humans, hospitality law and the guest right is a sacred custom. Even in the cities, there are few laws concerning it; rather, a common understanding derived from myth and two simple rules.
First, respect from host to guest. Second, respect from guest to host. Purported violations of hospitality are most often decided by mob justice.
Among supernatural beings, this is much more complicated.
Magic and Hospitality
The hospitality tradition among humans was learned from magical creatures, who take it very, very seriously. The duties of host to guest and vice versa are detailed and enumerated, and violating them takes a heavy toll. Creatures like dragons, goblins and trolls, ordinarily hostile, can be negotiated with by invoking guest-right. Of course, most people don't think to do that when faced down with a giant flame-breathing dinosaur.
Hospitality is deeply interwoven with magic, and beings which break it suffer a loss of magical power. A dragon will weaken and find their breath cold. A troll will find their flesh soft and unable to regenerate. Even goblins will shrink to diminutive rat-men, losing their cunning and ability to use tools.
Fae, elementals and other such beings are straight up made of magic, and so couldn't break hospitality law if they wanted to.These beings are defined as not having free will. It would be like a human deciding to stop their heartbeat.
Most humans aren't magical, and so don't worry about this. Wizards, however, are subject to this same restriction, and are very aware of this. They try to discourage guests as much as possible.
How to be a Guest
Gaining guest right can be tricky. First, you have to be somewhere that could be considered a being's home. A dragon's lair works, as does a goblin warren. But the land around such places doesn't. Once inside, you must address your host honorably and ask for permission to enter their home. Even if this doesn't work, this is enough to give most sapient creatures pause.
For creatures with free will, hospitality is enforced not just by loss of magic power, but by appearances. Sure, you could eat those stupid adventurers who asked for hospitality. They didn't do it right anyway, so you probably won't lose any magic power. But it's just plain gauche, and what if word gets out?
Intelligent magic creatures are very concerned with what others think of them. Not humans (high level wizards are not strictly human), but others of their kind. Not necessarily of the same species either. If an ancient manticore hears a local hydra has been flouting hospitality law, that's all the reason they need to start nibbling at the hydra's territory.
Fights over resources between such monsters are long, protracted, ugly and impolite, resulting in damage to all parties and the surrounding landscape. Whichever one survived would likely not be able to defend against an incursion by an opportunistic third party. As a result, resource disputes are mitigated by complex webs of alliances, with the weaker party willingly ceding.
This all turns on how well respected the monster in question is. Violating hospitality is like telling everyone 'Hey, I'm a big stinking liar! Don't trust me!"
"I know this mountain was yours last week, but then you ate that priest who asked for guest right, and we both know whose side the cyclopes will come down on."
As a prospective guest, be polite but insistent.
The next stage involves an exchange of gifts. This is where the danger comes in. Even if you've avoided getting slow-roasted, messing this up could put you right back at square one. That is, being something's square meal.
The guest presents their gift first. As always, it's the thought that counts, with value a close second. The big no-no is cash. Gift cards aren't any better. See, money on it's own is a transparent bribe. Note that bribery isn't a problem, but being obvious about it insults the host's intelligence, indicates you really don't care, and implies that the host is easily bribed. The host would be entirely in their rights to eat you.
Instead, a present should be valuable in a more subjective manner. Magic is, above all, based on emotion. A sack of coins won't do. A handful of coins reworked by a master goldsmith to show the host's face in profile shows thoughtfulness and a deep consideration.
While value is secondary, it could still trip up an inexperienced gift-giver. It doesn't matter how good a wood carver you are, presenting a carving you made ten minutes ago smacks of carelessness. At the same time, a gift whose value is too great is also a faux pas, for reasons about to be explained.
If your gift is accepted, your host but provide a gift of roughly equal value in return. 'Roughly' is the key word there. It's impolite to compare the exact cost of a gift, and against the spirit of the exchange. It's not the intention for any party to profit, rather the creation of a spiritual bond between you by the transfer of property.
Aside: That's not an exaggeration. A bit of your soul rubs off on anything you own, so an exchange of gifts results in the exchange of soul-stuff. It's spiritually similar (though different in magnitude) to friendship, marriage and sex. Items with more subjective/emotional value, whether due to memories or the work put into them, are capable of holding more soul-stuff. This is why ghosts are attached to significant items and why you can't make a phylactery out of a random grain of sand. Incidentally, selling an item dissipates the soul-stuff, while gift-giving doesn't.
If your gift was too valuable, it can be a problem. A gift must be answered in kind, and if the host cannot repay it, it brings dishonor on them. Deliberately giving someone an overly expensive gift is a subtle and effective 'fuck you'.
If the host is of lower status than the guest, the host is in for a bad time. If the king shows up at a peasant's home with a caravan of gold and silk, they're about to ask for something the peasant would rather not give, or ask a favor they would rather not perform.
If the host is of higher status, this is a grave insult. You're effectively mocking them for being poor, and calling their high status into question. While it would be difficult to give a dragon a gift they can't repay, I would recommend against testing this for yourself.
To avoid this, gifts exchanged are often incomparables. A finely crafted sword for an ancient bottle of fine liquor. A rare spell scroll for a stretch of fertile farmland. A set of glamorous robes for a closely guarded secret. An obedient slave for a noble title (intelligent monsters should have at least a few human slaves. They are, after all, monsters).
Guest Rights and Obligations
So, against all odds you've successfully invoked hospitality law. What are the rules?
As a guest, you must honor and respect your host, do them and theirs no harm, and not be a burden on them. That last part is less about strict costs of housing, and more about reading the room.
As a host, you are obligated to provide food, drink and baths. Other needs, like medicine and sanctuary from pursuers must be given if asked for. You may not allow harm to come to them while they are on your property.
Assuming hospitality is maintained until the guest leaves, the bond continues to exist, and even extends beyond the guest and host. If your ancestor held hospitality with my ancestor, that's a very good reason to deescalate tensions and negotiate, even exchanging gifts to continue that tradition.
This system works best for a game where players are expected to negotiate with and trick enemies. It's indicative of a particular world, where intelligent monsters are known, if not common. It emulates the ancient world and presumes an honor culture, as opposed to the modernistic feel of settings like the Forgotten Realms.
The main source for all this is the Iliad and Odyssey. The ancient Greek practice of xenia, though not a set of codified laws, was a strong cultural force in ancient Greece, and one of the tentpoles of the story. Paris breaks hospitality law by kidnapping Helen while being Menelaus' guest. The resulting dishonor is an insult to Zeus himself, the protector of travelers, which is why Menelaus is able to gather such a strong army to fight Troy.
Diomedes and Glaucus find that their fathers held xenia together, prompting them to exchange gifts and drop hostilities. Likewise, Ajax and Hector resolve to share gifts as a marker of peace between them. The gods appear to mortals in disguise and receive hospitality. Hell, the gods even host other gods, and make appropriate preparations.
Other examples, like the demands of the suitors on Ithaca and the seductions of Calypso and Circe show how xenia can be twisted and perverted by ill faith. The cyclops straight up ignores xenia, allowing Odysseus to blind him.
If your campaign shares these assumptions, establishing the code of hospitality as useful for players will add that texture and period feel.
Finally, another good source for hospitality is Ibn Battutah. The Muslim code of hospitality is similar to that of ancient Greece, with an emphasis on gift-giving. The sheer volume of gifts IB received should give you some material to work with when your players ask for gifts in turn.