Legal or not, it isn't advisable to get a tattoo while you're pregnant. There are many things going on and changing in your body at this time, and you shouldn't take any risks or complicate matters. Allergies can change during pregnancy. Your chemistry changes. There is another life taking form inside your body.
The tattoo is an open wound on your skin, and it takes time to heal. Tattoos can become infected. Unclean practices in the tattoo parlor can result in the transmission of diseases. With all the things that are taking place inside you, and the other life depending on yours and on your good health, it would be best for you to wait until after the baby is born. There will be plenty of time, after all, once you have given birth. Even then, it's advisable to wait until you are done breastfeeding the baby, if you are planning on doing that. The risk of infection extends to the baby at that time as well, if you do have the bad fortune of getting an infection from your tattoo.
As for legality, the laws are depend entirely on the state and locality where the tattoo parlor is located. Look into your local laws to find out. Again, we strongly advise you to wait until after your baby is born. You may also have a hard time finding a reputable tattoo artist who will perform the tattoo.