Can I wear an underwire bra while pregnant?

If not uncomfortable. ...Then, yes - but obviously there is more chance of it pinching.
Yes. A good supportive bra is a wonderful thing! as long as they are comfortable, underwire bras are fine in pregnancy. There may come a time when the wires dig in or are uncomfortable. At that point you should change to something else.