A shiny Pokemon can hatch from any egg, not always the 30th one. Guides recommend hatching eggs in batches of 30 because 30 Pokemon is exactly one PC box, so it's a convenient number. Also, they recommend hatching the eggs after collecting 30 of them because, if none of them are shiny, you have to save after hatching eggs. If there's an egg in the day care when you save the game, and that egg turns out to be the shiny one, then you can't swap that shininess onto another egg.
source