When in doubt, ask your doctor!
As long as it's not an Nsaid, and more like IcyHot or something, then yes it's completely safe.
I also use something called a "lidoderm" patch which has lidocaine in it but doesn't really go into your bloodstream. it's used for arthritis and localized pain and helps my back sometimes when my pain level isn't too high.
Ask your Dr. I'm pretty sure that it would depend on the cream. I was using a prescription NSAID cream before I got pregnant and had to stop once we found out because they don't know the risks and how much might actually get into your bloodstream. I know that most Dr.'s recommend tylenol as a safe pain killer during pregnancy.
Good Luck!