Is it safe to have or get a tattoo while pregnant?

Tattoo. Pigments and dyes are chemicals and it is prudent to avoid any unnecessary chemical exposure during pregnancy. Don't do it.
Yes. Getting a tattoo gives you some risk of developing hepatitis which may be in a short course or after significant time has passed. Much less likely if gotten at a reputable locale as they are much more likely to take precautions to ensure sterility of the needles. That is the same risk whether you are pregnant or not. Certainly a case of buyer beware.