The concept of the Law-Chaos as appearing in fantasy worlds dichotomy originated with Poul Anderson's Three Hearts and Three Lions, although the underpinnings are much older[1]. Law was what humanity and civilization represented - the imposition of an order on savage, unpredictable wilds - while Chaos was what most non-human things thrived upon: the strange, the weird, the random, and above all, the magical.
Michael Moorcock adapted this, although the interpretation of it grew as his universe expanded. In his earlier works Chaos was essentially antagonistic, even to Elric, who drew his power from it; Law were basically the good guys, albeit ambiguously so (imagine living in a village in France in 1944: Nazis are Chaos, definitely bad guys, but the Allies are Law, and your well-being is for them somewhat secondary to fighting their enemies). Over time, the idea of Balance emerged as an alternative to either side, and although in D&D terms it is 'neutral', in Moorcock's writings it basically became the "good" side and emphasis was put on the reflective similarities of Law and Chaos, at which point they're both basically "evil" (at least once Elric fights a demon and is surprised to learn that it is a demon of Law, not Chaos), but this development didn't occur until well after the D&D system was established.
In the first edition of D&D, Andersonian terms used, but were essentially stand-ins for Good and Evil. PCs were supposed to be Lawful, so Chaotic monsters were the ones you were supposed to fight and Lawful monsters the ones to be friendly with. Supplement I: Greyhawk
had an implicit separation of good from evil, presumably to encourage Chaotic PCs in order to make the newly-introduced Paladin class seem to have more restrictions, but this wasn't made explicit until 2nd edition D&D. When AD&D was first released, D&D went back to the simple Lawful-Neutral-Chaos model and, for the first time, good and evil were fully fleshed out as principles and possible player character alignments.
Roger Zelazny's Chronicles of Amber series also makes use of a Law vs Chaos dichotomy, although it is introduced too late to have a defining influence on D&D, it reflects the characteristics of the two as they appear in AD&D: there are numerous good and bad characters on both sides of the Amber/Courts of Chaos conflict.
With each new product or edition the definitions of the alignments evolved slightly, but it always remained complex and confusing or unsuitable for many people, leaving a lot of variant interpretations and house rules (I, for one, am not satisfied with any printed description of Lawful Evil - that should be where a killer with a sense of honor is found, but the rules never support that interpretation). In the end the philosophical differences between law and chaos were discarded, so that Lawful Good meant "exceptionally good" and Chaotic Evil "exceptional evil"; many people already played as if that were the case.
[1] They can be traced to ancient Greek philosophy, with positive concepts like logos and kosmos (order and reason) opposed to negative ones aporia and khaos (confusion and chaos). Nietzsche, with other German scholars of the 19th century, identified these two modes as Apollonian and Dionysian, the idea being that human nature was a merger of civilized Apollonian tendencies with the wild, animalistic Dionysian ones. Some also read similar ideas into the Epic of Gilgamesh.
Interestingly, the Egyptians had a concept of order but two concepts of chaos; one, represented by the god Seth, is the kind of chaos found in markets and nature, that which sometimes causes some destruction but is also the source of creativity and new growth, and the other represented by the serpent Apep, is the violent, primordial chaos that only destroys. What makes this arrangement interesting is that Seth was the protector of order (in the form of Ra) against Apep.
The Comeback Inn played a prominent role in Dave Arneson's Blackmoor campaign:
From the day the walls started to go up, the establishment was an
important landmark in the North. Few who stopped in Blackmoor failed
to make an appearance there. As a result, the inn soon became an
informal labor exchange and information market. Whether a person
sought to hire the services of a wizard, wanted to hear the real tale
of the founding of Lake Gloomy, or just craved good food and drink,
the Comeback Inn was where he would stop.
It was also set up as a gateway between Blackmoor and other worlds, further facilitating adventures. As other answers have mentioned, the concept of an inn as an information and transactional hub was well established long before RPGs were created, but given the importance of Blackmoor it's likely the Comeback Inn strengthened the role of the inn in fantasy RPGs.
Best Answer
Before original D&D was published, but after its invention and they'd started playing it, the story I've heard is that a Dave Wesley found these odd dice in an educational supplies catalogue and thought they might be good for the game. Gary Gygax had a love of statistics and probability, and that probably had a lot to do with his quick adoption of the dice.
Polyhedral dice were called for in the original D&D, and low-quality pack-in dice sets appeared in the boxed editions, so they've been part of the game since the beginning. Though some few rare wargames may have used them, that's not from whence they came to D&D.
Ah, I found the quote I was remembering. Greg Svenson, one of the original Blackmoor players, recalls: