The situation you are describing is often described as "Hospice", you are providing comfort care for a sick being. Quality of life is more important than quantity of life, comfort over living longer.
If it feels good, and adds to the comfort it is good.
It sounds like you are making the important steps in monitoring the application of heat for safety. Temp is not too high, always supervised if they are unable to move away from the heat, monitoring that electrical cords are not chewed on.
Additionally in my area there are veterinarians who specialize in hospice care if you are lucky enough to have one in your area, contact them. Ours makes house calls, and the comfort they give to the pet and family can be significant.
Directly speaking to the use of heat for pain management, current practice is to include heat as part of solution.
Non-pharmacological methods to manage pain include cutaneous stimulation techniques (heat and cold applications) acupuncture, psychosocial methods of care, holistic management and pastoral care. source