It’s perfectly safe to take them at the same time and was the exact advice given to me after having my wisdom teeth extracted. You can even buy medication that has both ingredients, like Excedrin. One is metabolized by the kidneys and the other by the liver.
This combination is actually shown to work better than opiates for dental pain