YES, there is some truth behind the "1 billion heartbeats " claim.
And when I say "some" I mean the creator of the comic didn't just make it up out of thin air.
While it's not literally true that all animals get 1 billion heartbeats before they die, a relation between metabolic rate (which is related to heart rate) and life span has been observed.
San José State University - Animal Longevity and Scale:
Heart rate and life expectancy in mammals and humans:
Life expectancy and total heart beats per lifetime in mammals
As a corollary, the basal energy consumption per heart beat and heart mass may be the same for all animals.
This suggests that the life span is predetermined by the basic energetics of the living cells, and that the apparent inverse relation between life span and heart rate reveals the heart rate to serve as a marker of the metabolic rate.
This may be exemplified by considering the vast range of physiological cardiac parameters between one of the smallest, the shrew weighing 2 g, and the largest extant mammalian, the blue whale of 100 000 kg.
Despite a difference of many millions in body weight, heart weight, stroke volume, and total blood pumped per lifetime, the total oxygen consumption and ATP usage per unit mass and lifetime are almost identical together with the total number of the heart beats per lifetime.
Mice and Elephants: A Matter of Scale
As animals get bigger, from tiny shrew to huge blue whale, pulse rates
slow down and life spans stretch out longer, conspiring so that the
number of heartbeats during an average stay on Earth tends to be
roughly the same, around a billion.
Mysteriously, these and a large variety of other phenomena change with body size according to a precise mathematical principle called "quarter-power scaling".
It might seem that because a cat is a hundred times more massive than a mouse, its metabolic rate, the intensity with which it burns energy, would be a hundred times greater. After all, the cat has a hundred times more cells to feed.
But if this were so, the animal would quickly be consumed by a fit of spontaneous feline combustion, or at least a very bad fever. The reason: the surface area a creature uses to dissipate the heat of the metabolic fires does not grow as fast as its body mass.
To see this, consider a mouse as an approximation of a small sphere. As the sphere grows larger, to cat size, the surface area increases along two dimensions but the volume increases along three dimensions. The size of the biological radiator cannot possibly keep up with the size of the metabolic engine.
Things behave differently at different scales, but there are orderly ways -- scaling laws -- that connect one realm to another.
Metabolic Rate and Kleiber's Law:
The first accurate measurements of body mass versus metabolic rate in 1932 shows that the metabolic rate R for all organisms follows the 3/4 power-law of the body mass,
R ~ M3/4
This is known as the Kleiber's Law.
The reasons behind the power law are not yet fully understood, although there are of course theories. But since the OP's question doesn't actually ask for an explanation I feel it's okay to leave it to the interested reader to click through the links above and below to learn more about the proposed theories (plus, I believe it would make my answer just unbearably long if I include them in my post).