Obesity is a condition, not a virus or disease, so any animal can be obese. The definition of this condition is when the animal is more than 20% over its ideal weight, which applies to humans and non-humans alike.
Now, medically, there's some question and debate about what an ideal weight is depending on a person's body type, genetics and frame. It's pretty easy to say there is no one size fits all definition of who is obese and who isn't. But the 20% rule of thumb is pretty good all the way around. More specifically, a BMI (Body Mass Index) of 30 or above is also considered obese by the National Insitute of Health.
So yes, the dog or cat can be obese, and as pohnpei pointed out, many, many pets are. Perhaps because the pets tend to have the same activity levels as their owners.
Certainly dogs and cats can both suffer from obesity. In fact, acccording to the article in the link that I am providing below, something in the range of 40% of all American pets are overweight.
Many dogs and cats are kept in houses and do not get to go outside very much. Or, in the case of dogs, they do not have a big enough yard to run around in.
In these cases, the pets can get to be overweight or obese. This is especially true if the owners do not limit the amount of food their pets are allowed to eat.
Animals in their natural environment do not suffer from obesity because they of limited supply of food available, the active life they are forced to lead, and their inability to survive with handicaps associated with obesity. However all pet animals including dogs can and do become obese when they are over fed and do not receive adequate exercise. As a matter of fact I have seen several pet dogs becoming obese because different reasons like the owners pampering their pets, or keeping their dogs chained most of the time giving them very little opportunity for exercising.