This claim is not necessarily true. There is not evidence that suggests cats and dogs can predict earthquakes. "The paper published in the Bulletin of the Seismological Society of America instead suggests that most of this evidence consists of single observations and anecdotes that cannot be tested rigorously." This information was gathered from the first documented extensive testing of this claim. The researchers collected information on reports of abnormal animal behavior leading to earthquakes of all different types of animals, and the data was very inconsistent, and most are single observations.
https://www.seismosoc.org/news/can-animals-predict-earthquakes/
My information is from a very reliable source. This organization is a top-level domain and source. And they got their information and data from a true, backed investigation into this claim.
So unfortunately, there is no real evidence that animals can predict earthquakes, although it does not necessarily mean the claim is wrong.