Genetics in-universe appear to follow real-world genetics.
All the examples you list follow the dominant trait of their parents:
Parents are Lyanna Stark (mother) and Rhaegar Targaryen (father). Lyanna had dark hair (dominant) while Rhaegar had silver/blonde hair (recessive). Jon has dark hair.
Parents are Joanna Lannister (mother) and Tywin Lannister (father) (yes, they were cousins). Both parents had blonde hair. Tyrion had blonde hair.
Alternate theory: Parents are Joanna Lannister and Aerys "The Mad King" Targaryen. This is a popular theory because Tyrion's hair color has been described as closer to silver, which is a trait of Targaryens. However, this would not affect the genetics, as both parents would still have the recessive trait.
Parents are Cersei Lannister (mother) and Jaime Lannister (father). Tommen is not related to King Robert, despite having the Baratheon name. Both his biological parents have blonde hair. Tommen has blonde hair.
Also, remember from an out-of-universe perspective that actors may not have the exact hair or eye coloring that their characters are described as having in the books.