The original concept album of Chess has an interminable song called "The Story of Chess", in which lyricist Tim Rice shoved way too much ancillary information about the origins of the game. It's generally cut from the staged versions. Later versions had information more inconspiculously worked into the background lyrics in "You and I/The Story of Chess", "Endgame", and "The American and Florence".
Part of the reason Oscar Hammerstein II wrote "A Real Nice Clambake" for the second act opening of Carousel was to demonstrate his research into authentic New England cuisine. (Hammerstein, however, didn't do his research on "June Is Bustin' Out All Over," and so had to Hand Wave why the sheep were mating in the spring rather than their usual late autumn/early winter season.)
1776 does this concerning the Continental Congress and figures in early American History. For example, the Running Gag of John Adams being "obnoxious and disliked" by everyone in Congress comes from his own description of how other people viewed him, the New Jersey delegation was actually missing from Congress for a while, and New York never voted on anything. Many of the more memorable lines are straight historical quotes, or very slight paraphrases of them. Given the attention to historical accuracy that perfuses the thing, the few obvious strays from history that are made are that much more puzzling — Caesar Rodney and John Dickinson in particular are portrayed quite inaccurately. You could chalk them up to dramatic license, but given the actual drama that hardly seems necessary. note John Adams' quote about the slavery issue causing war "a hundred years hence" was real... too real for the musical.
All those obscure and not-so-obscure quotes and references in The History Boys? Accurate, and what's more, each of them in some way contributes to the philosophical argument of the play without most of them ever being explained to the audience. The original stage cast effectively took an intensive literature and philosophy class during the initial rehearsal period to make sure they understood all the references and could deliver them so as to have the right impact.
Gilbert's set designs for H.M.S. Pinafore were so thoroughly researched and meticulously detailed that senior naval officers complimented his accuracy, and the sailors' uniforms were made by the same tailors in Portsmouth who made the real uniforms for the Royal Navy. Yet wooden, sail-driven warships like the Pinafore was meant to be were obsolete by the time the Navy adopted uniforms for the sailors; Gilbert just knew that a uniformed chorus looked better.
In The Yeomen of the Guard, which is set early in the reign of Henry VIII (c.1520), Gilbert correctly puts Yeomen of the Guard on duty at the Tower of London instead of Yeomen Warders (the former guarded the Tower from 1509-1548, when the latter formed to take over those duties). He also received critical praise for the accuracy of his set design, which included a building (the Cold Harbour Tower) that had been destroyed long before the 19th Century. And yet, again for Rule of Cool, the chorus of Yeomen were dressed in the Elizabethan uniforms audiences were familiar with.
Most of The Mikado foregoes accuracy in favor of Rule of Funny, but Gilbert did hire a Japanese tea-girl to teach the "little maids from school" how to comport themselves like young Asian ladies.
Stephen Sondheim quotes a great deal of the characters' writing in Assassins. Most famously, Guiteau's half of "Ballad of Guiteau" (the "I am going to the Lordy") is almost completely lifted from an actual poem written by Guiteau himself that he recited on the gallows before he was executed.