Yes, simply put. In fact in urgent pain and/ or muscle injury taking both is a common thing.
They have differing affects.
But, please be aware that one should try not to take either of these drugs indefinitely or for any reason except for an acute need due to injury or trauma.
Both of the drugs you mentioned have significant addictive properties. Please be careful.