It's like comparing apples and oranges. Although both seem to be the same, they are rather different.
Both Yoga and Pilates offer stress relief, flexibility, strength control and endurance but Pilates emphasizes on core strength whilst Yoga emphasizes on flexibility and broad muscle groups.
Yoga is more spiritual and meditative and encompasses good breathing techniques which will help you in labour, whilst Pilates strengthens your tummy, back and pelvic floor muscles without straining other body parts.
Both are safe to do when pregnant as there are variations and different poses which are still suitable for pregnant women.