If you get the may cast talent it will cast the spell itself you can't control that. If you get the card it will be in your deck when you have that pet equipped.
Pet spells are random, train it until it gets "may cast" abilitys for example my frankenbunny might learn may cast healing current, If I were to go into a battle with this pet ability and pet equipped and my health goes down I would have a slightly higher chance of being healed without using pips