This theory is two-fold.
First: Mood is contagious. So being in a good mood yourself is the most direct way to make others get into a good mood too. And that's what makes us like being around someone. When they make us feel good.
Second: It is possible to learn how to get into a good mood. It's not so much related to the situation around you, which mood you are in. It's more of an internal state. Similar to how you can change your physical posture, you can put yourself in different mental postures. The more you practice, the better you get at it.