The idea came from the late 80s, when there was a report of a woman who had a lesion on her leg. Her dog obsessively and repeatedly kept sniffing at it, and eventually tried to bite it. Instead of chastising her dog, she went to the doctor and had the lesion checked out. Apparently, it was skin cancer. (2)
The dog may have saved her life, because the cancer was in its earliest stages, where it's treatable. Cancer is nearly unstoppable past a certain point, as "cure rates decrease dramatically as the cancers become more advanced." (1)
Recently, dogs have been trained to sniff out breath, feces, and urine to detect cancer. Detection rates are as good as 95% and 98% accuracy in breath tests, which are considered as good as colonoscopies, (1) a painful procedures in which a camera is inserted into the rectum. One preliminary test that tested trained dogs' ability to detect through urine had a success rate of 41%, which is far beyond that expected by random chance. (2)
Seems that the title of "man's best friend" has a new meaning these days.