I'm in the US and have gotten Xanax a few times from my doc. Xanax has nothing to do with opioids. For that matter I have had no problem getting opioids when they were indicated (from the Emergency room physicians after getting an acute injury.)
(The combination of BZs and Opioids is not always dangerous in people who are experienced with the drugs, but can be a dangerous mixer for people who don't have tolerance.)