Opioids, on the other hand, are used to treat more severe pain in dogs. They work by binding to receptors in the brain and spinal cord to block the sensation of pain. Some common opioids for dogs include tramadol, codeine, and fentanyl.