Yes, you can - but only before it is born. But if you are talking to the parents-in-waiting, you would tend to say "the baby" or "he or she" rather than "it". And if the parents know the *** of the baby before birth, it would be rude to use "it" after they tell you whether it's a boy or a girl.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.