PetSafe dog door closed IF garage door is open?

If you have the petsafe door already working with SmartThings, you should be able to do this quite easily with core, which allows for a “while” condition