town and county in England, Old English Deorby "deer village," from deor "deer" (see deer) + by "habitation, homestead," from a Scandinavian source (see first element in bylaw). the annual Derby horse race, the most important in England, was begun 1780 by the 12th Earl of Derby and run at Epsom, Surrey; the name was used for any major horse race after 1875. Hence Derby day (generally the Wednesday before Whitsuntide), etc.
Derby dog, something that "turns up" without fail, as the proverbial dog on the race-course on Derby day, after the track is otherwise cleared for the races. [Century Dictionary; the phrase is attested from 1858]
The type of stiff, felt hat with a rounded crown and more or less narrow brim was manufactured in U.S. by 1850 and called by that name by 1870; perhaps so called because it was worn in riding. It came in as a fashionable novelty in 1874.