My husband died in 2023, so the same sort of thoughts have been going through my head.
First: I am sorry for your loss, I don't know how recent it is, but that is not really relavent, as we all mourn differently.
With regards to your dog: I was uncertain from what you wrote, whether you are most worried by the thought that if you died in the night, or fell or something like that, the poor animal might be distressed or even die of thirst before you were found, or whether you are concerned about what will happen to the dog, if he outlives you.
The first eventuality can be dealt with by simply finding someone, perhaps a friend of your own age, whom you can phone or text every morning, simply "Good morning, how are you?"
This is what my aunt did in her old age, as she lived alone - her next door neighbour was a similar age, and also on her own. So the two ladies had agreed to phone each other every day before a certain hour that suited them both. If no phone call had been received by one of them, they were to use their spare key and go in, or simply phone the police and state their worry.
Obviously, if either was going away, she told the other in advance.
Here in Denmark the organisation that roughtly corresponds to Age UK has a scheme by which you can ask your local unit of the organisation for a phone call every day - they then know whom to contact if you don't respond.
Regarding the dog: make arrangements with your sons regarding their either re-homing it, if it outlives you, take it themselves, or if it is old and infirm have it put to sleep. I have simply included in my will that my son is to decide what to do with any household pets that may survive me.
On a daily basis, make sure you fill the dog's water bowl up every evening at bed-time, so you are sure it will be all right, if you should be taken ill, until someone arrives to take care of it.
I carry a card in my purse w ith contact information for my son, who lives at the other end of the country, and a neigbour requesting that both should be contacted if anything happens to me, as there are pets in the house.
I hope this helps.
Keeping a mobile phone handy is sensible, but impracticable, as smart phones are too big to fit into my pockets, and I have dropped my phone out of my pocket in the garden more than once, so I no longer take it out if I am gardening. My daughter thinks this is stupid, perhaps she is right. I do take my phone up to my bedroom at night.