A lot of people believe that dogs don't have feelings like people do, but there is a ton of evidence to support the notion that dogs can be optimistic or pessimistic based on the environment around them.
As explained in this video by Discovery News, lab testing revealed that dogs trained to expect good things when hearing specific sounds reacted happily when they heard those specific sounds, but the opposite happened when they heard sounds that they were trained to link to less interesting things.
For example, if you've ever seen your dog's ears perk up when you ask them if they want a treat, or to go for a walk, it's because you're making them excited, hence the optimism. But if you constantly tease your dog and never go through with it, you might notice that they lack enthusiasm, hence pessimism.
Dogs are thought to have similar emotional functionality to a human toddler, but not quite as complex as that of a fully-grown human adult. The idea that dogs can express optimism or pessimism suggests that these are two of the emotional feelings that dogs can relate to.