Does a tampon prevent the sperm from fertilizing the egg at all?

NO !! of course not ,, think about how it got there to start with, no!!!! the sperm got there first... a tampon would just push it in further. Even if you did for some reason choose to have sex with a tampon in, this will not prevent pregnancy because the tampon would just absorb some of the semen, and it would still be "in there" Good luck trying to find the tampon after having sex with it in.