Can medications cause sleep apnea?

Unlikely. If someone has airway obstruction and bad snoring they can have something called "upper airway resistance syndrome" or "pre-apnea." sedatives or narcotics can make someone with this condition worse leading to true apnea.
Yes. Narcotics are a classic example of medications that can cause sleep apnea (central).