Most human cancers are not (very?) contagious (perhaps besides a couple of incidents). But the Tasmanian devil seems to have a form of cancer which is contagious. Now what makes the difference between a contagious cancer and a non contagious cancer in the DNA mutations of a cell?
There are two relatively common contagious cancers: Tasmanian Devil Facial Tumor, and Canine Transmissible Venereal Tumor. Both are truly contagious cancers, in that the cancer cells themselves are transmitted from one host to the next, and expand and cause disease in each successive host. (There was also a contagious cancer of hamsters, which has long since gone extinct, and there are some transmissible tumors in clams and oysters; the latter don't have immune systems that are remotely similar to dogs, Devils, or humans.)
It's believed that one key aspect of the Devil Facial Tumor is that Tasmanian Devils are immunologically closely related. Normally, cancer cells from one host would be a tissue graft in a different individual and would be rapidly rejected as with any allograft. However, immunologically closely related individuals can tolerate each others' grafts, and it's believed that this is part of what allows the Devil tumor to spread -- a lack of genetic diversity among Tasmanian Devils.
Major histocompatibility complex class I and class II genes have extremely low levels of sequence divergence in the devil population from the Tasmanian east coast (Siddle et al., 2007a, 2007b). ... The lack of diversity at MHC loci, coupled with weak responses of east coast devils to allogeneic mixed lymphocyte culture, has led to the suggestion that this population may be functionally identical at MHC loci, thus permitting the spread of DFTD as an allograft.
The genetic diversity explanation is widely accepted, but it hasn't been formally proven and there are a number of points that suggest that it isn't the whole story. There are several other molecular features of the tumor that probably make it less immunogenic (see the review The role of MHC genes in contagious cancer: the story of Tasmanian devils) and the full story probably involves a combination of these things.
CTVT is different. It's astonishingly ancient (it apparently arose in a dog, or a wolf, 11,000 years ago and has been passed from dog to dog continuously since), so it's obviously very successful at what it does, but it's not at all understood how it does it. Dogs are genetically pretty diverse and definitely don't tolerate arbitrary grafts from each other, so that's not the explanation. Lots of other possible explanations have been put forward, most of which point to various immunological features of the tumor; however, while that's clearly an important point, none of the things people have implicated are unique to CTVT -- tumors invariably have immune suppressive abilities and don't have the same ability to spread. (Going back to the Devil tumors, the low expression of MHC molecules on the cancer cells is probably a factor there too, but it's important to understand that low MHC expression is almost universal among tumors, including the vast, vast majority that can't transmit.)
- There do exist a very small number of truly contagious cancers.
- The reasons for their transmissibility are not fully understood.
- Genetic diversity and immune evasion are probably two of the causes.
Different mechanisms can explain why some cancers are contagious. They don't necessarily belong to the same category.
For instance, certain cancers, like the cervical cancer, can be caused by viruses (in that case, HPV). The cancer itself is not contagious, but the virus is. Other famous viruses that can cause cancer are HTLV-1, MCV, Herpes Virus 8 (or KSHV), HCV, HBV and EBV.
The case of the Tasmanian Devils is more complex. It was thought for some time that the same viral mechanism could explain the Devil Facial Tumour Disease, or DFTD, specially the fact that DFTD is contagious. However, there is no evidence (to date) of such a virus.
Thus, some alternative hypothesis have been proposed, such as environmental toxins.
Trials are being held to examine the transmission of Devil Facial Tumour Disease. Preliminary results support the increasingly accepted hypothesis that we are dealing with a transmissible cancer and that cancerous cells are passed directly between devils as an allograft. Put more simply, we are getting more and more evidence to support the theory that DFTD is spread by the cancer cells themselves being passed from one animal to another. (emphasis mine)