Yes, certain painkillers and over-the-counter medications can affect sperm quality. Consider having a semen analysis test to check your sperm quality before planning to conceive.