Most dogs who act like they are always hungry are not actually feeling that way, but are trying to manipulate their owners into giving them treats. Dogs have also evolved to eat large amounts when available because food is scarce for wild animals.
There are some medical problems that can cause constant hunger, including diabetes and hyperthyroidism. However, these are fairly uncommon and typically come with other symptoms. Many healthy dogs act like they are always hungry because periods of food scarcity were normal until relatively recently in their evolutionary history. As a result, many dogs eat as much as possible when food is available. Dogs also evolved to depend on humans for food, so historically begging gave them a survival advantage.