It is generally safe unless your doctor has advised bed rest. But since I had thyroid issues, I always double-checked with my doctor during regular visits just to feel safe.
Unless your doctor told you to avoid orgasms due to complications, it is totally safe and a free way to reduce stress! Just mention it to your gynac during your routine checkups.