Yes, no, or sometimes.
PIR would have to be suitably rated for the zone of the bathroom it is located in.
the bathroom electrics should be rcd protected.
if there is steam in the room, a PIR may well be of little use. perhaps a microwave sensor would be better.
if it is for the light, then some lights have built in microwave sensors.