Well, for one, Nicholas Flamel was a real person. For another, the Philosopher’s Stone (“Sorcerer’s Stone” in the American edition, presumably because we aren’t expected to know our cultural heritage) is a key notion in alchemy. Dumbledore is an obvious Merlin figure. Magical creatures such as dragons and boggarts are familiar in traditional lore. The whole idea of action at a distance (“magic”), with its potions, charms, spells, incantations, etc., etc., is about as old as humanity.