Scientific consensus these days is that most animals cannot feel complex emotions, such as sadness, or joy.
Animals can feel pain (that's a sense, not an emotion though) and satisfaction of wants and fear, but only few species have a range of emotions beyond that.
Among birds, only corvids (ravens, crows) are suspected to experience emotions, because they tend to invent games / do things for their amusement.
In mammals, it is mostly whales, apes and rats that are suspected to be capable of emotions.
Does a dog get sad when you yell at it? Definitely.
Sorry to disagree, but it's more likely to experience fear than sadness. Sadness is a rather complex emotion, and animals such as dogs are too simply structured (for example, that's why you should reprimand a dog immediately after it has done something bad, because otherwise it cannot make the mental connection).