If caring for elderly or ill dogs causes you this much worry, it may be in your best interest to just not watch those dogs. The chances of an older/ill dog passing away in your care are still fairly low, though it is always a possibility, and if you are stressed, the dog will pick up on that and feel more stressed as well.
If you continue watching older or ill dogs, discuss the dog's conditions thoroughly as well as the owner's wishes when it comes to providing care so that you feel comfortable with your role should the dog's condition worsen in your care. Read over a POLST or Advanced Directive (documents describing what medical interventions a patient wants/doesn't want) to get a better idea of the questions you might ask owners--it won't all apply, but much of it will. I've had a dog with terminal cancer. He was only 5 when it was discovered. The vet and I agreed on an aggressive treatment which was very hard on him, but the hope was that putting him through the harsh treatment would buy him years of quality, cancer-free life. After a few months it became clear he was not going to survive his illness, and the most important thing became making sure he was comfortable and enjoying the life he had left. When I could no longer maintain his quality of life, attempts at prolonging it were no longer a priority. Be clear on what the owner's priorities are in their dog's care. At this stage in their dog's life are they most interested in providing comfort or prolonging life?
Finally, I would make sure to get emergency contact info for someone local who knows the dog if possible. In the event of the dog's condition worsening in your care, the owner (and you) may feel more comfortable if someone the dog is familiar with can be present to provide support.
And of course, it's always alright to decline a stay if you aren't comfortable with it. There will be other sitters who are more comfortable and experienced with the special needs of older or ill dogs.