Often this behavior is accompanied by profuse salivation. In this case, you must definitely eliminate the cause of irritation, and over time, your dog will calm down and return to normal.
It is also worth noting that, sticking out the tongue, the dog expresses its positive mood. It can be playful or friendly emotions, the joy of meeting, trying to get a treat or a demonstration of a good relationship.
Some dogs are physically unable to hold the tongue inside the mouth, due to the peculiarities of the structure of the jaw and oral cavity or lack of teeth.