Both hold true.
Yawning is a calming signal - so if you yawn you are signalling that there is nothing to worry about. I have used this to great effect in a range of situations, from grooming to passing fear aggressive dogs....
If your dog is yawning, it can be an attempt to calm itself down - which wouldn't be necessary if there wasn't some stress to begin with!
However it's more likely to be evident AFTER a stressful event... rather like we humans start breathing again after the danger has passed...