You should get the first pet carrier for free, at least that was the case if you'd sign in after the update that provided the game with pets and pet carriers. I don't know if you still get your first pet carrier for free if you'd do that post-update.
Other than that, the pet carriers need to be bought. When the update launched, several game news websites reported the same explanation:
"Pets, like Mister Handy, can be purchased separately via “pet carriers,” and overseers will receive one free carrier after updating." (source)
Some people report that only a small part of the pets, like Mr. Handy, can be unlocked by completing challenges.