You're likely thinking of A Dog's Purpose (2017).
The film follows Bailey, a dog reincarnated across multiple lives with different owners, exploring the human–dog bond through joy, loss, and reunion. While it doesn't depict a simultaneous death of a specific human and dog in a single moment, it portrays their profound connection and mutual grief across lifetimes.
Other films with notable human–dog death themes: Marley & Me, Hachi: A Dog's Tale, Old Yeller.