So you noticed, this too. Not many people notice. There IS a scientific reason:
Embryonically, there are 3 germ layers: ectoderm, mesdoerm, and endoderm. (You can google them if you want). The tooth enamel (the outermost part) and the skin both derive from the ectoderm.
Have you ever noticed that natural redheads usually have a very fair, translucent skin? In general, their skin is thinner than that of people with other hair colors. And having been derived from the ectoderm, their tooth enamel is thinner, as well.
So the effect you see, due to the thinner enamel, is more of the underlying tooth surface (dentin) showing through the enamel. And the dentin is normally a yellowish or grayish color. As a result, the redhead's teeth will appear to be less white, because more dentin is apparent.
Because this is all happening as the embryo is forming, it's nothing you have to worry about, if you wish to color your hair - it's not going to change your tooth enamel.
So you can feel safe in coloring your hair red - it won't make your teeth look yellow!
I'm a dental hygienist