Yes, the teeth whitening gel is safe. The by-products when peroxide is broken down is largely oxygen (the byproduct that allows for the whitening process) and water.
For your comfort, during the in-clinic teeth whitening procedure, a suction device will be used to remove any excess saliva that may pool around the mouth.
In case you happen to swallow any teeth whitening gel, and you’re concerned about the peroxide in the whitening gel, fear not, it’s unlikely to be a large enough quantity that could harm your body.