Just adding this because it's kind of interesting: while you can do this in the later games, G/S/C actually did have a mechanism to prevent father/daughter and mother/son incest. In those games, the Defense IV was always passed down from the opposite-gender parent, and the Special IV of the child was always the same or differed by exactly 8 from the opposite-gender parent's. When determining breeding compatibility, the game then checked if the Defense IV matched and the Special IV was the same or differed by exactly 8, and if that was the case, they would prefer to play with the other Pokémon than with each other and never produce an egg. The normal odds of two Pokémon being incompatible in this way were 1/128, but it would always prevent you from mating a Pokémon to its own parent.
That said, you could still mate a Pokémon to its sibling, grandparent, etc.