Some of the best-known traditions, including carnal parades and masquerade balls, were first recorded in medieval Italy