Cancer a method for early Earth Evolution?
There is a lot of terminology, semantic and biology to be discussed if one was to fully answer your question and it would take a whole book. Below I am just trying to push you to reading more on the subject.

Evolution of cancer prevalence

The probability of getting a cancer is under selective pressure for sure. Citing cancer.net, here is some information on the genetics of cancer:



Many of the genes that contribute to the development of cancer fall into broad categories:


Tumor suppressor genes are protective genes. Normally, they limit cell growth by monitoring how quickly cells divide into new cells, repairing mismatched DNA, and controlling when a cell dies. When a tumor suppressor gene is mutated, cells grow uncontrollably and may eventually form a mass called a tumor. BRCA1, BRCA2, and p53 are examples of tumor suppressor genes. Germline mutations in BRCA1 or BRCA2 genes increase a woman’s risk of developing hereditary breast or ovarian cancers. The most commonly mutated gene in people who have cancer is p53. In fact, more than 50% of all cancers involve a missing or damaged p53 gene. Most p53 gene mutations are acquired mutations. Germline p53 mutations are rare.
Oncogenes turn a healthy cell into a cancerous cell. Mutations in these genes are not inherited. Two common oncogenes are:


HER2, which is a specialized protein that controls cancer growth and spread, and it is found on some cancer cells, such as breast and ovarian cancer cells
The ras family of genes, which make proteins involved in cell communication pathways, cell growth, and cell death.

DNA repair genes fix mistakes made when DNA is copied. But if a person has an error in a DNA repair gene, these mistakes are not corrected. And then they become mutations, which may eventually lead to cancer. This is especially true if the mutation occurs in a tumor suppressor gene or oncogene. Mutations in DNA repair genes can be inherited, such as with Lynch syndrome, or acquired.




Somatic Evolution in cancer

A cancer is a group of cells that proliferate. In other words a cancer is a group of cells having a higher fitness than other cells.

See Wikipedia > Somatic Evolution in cancer

Can a cancer be beneficial?

I am here attempting to answer your specific question.

We define a cancer based on the fact that it is detrimental to the organism carrying it. If a group of cells divide a lot more than the others and this is beneficial to the organism, then it is not a cancer but an adaptive developmental process.

Let's generalize the definition of cancer

To generalize the definition of cancer, one can say that a cancer is a group of individuals that proliferate to the detriment of the group. In other words, we need a social group of individuals (such as a multicellular organism) to get a cancer. Depending on your definition of a social group, one could consider a criminal organization as a cancer to human society.

If you push the definition a little further by either leaving out the need of a close phylogenetic relatedness between individuals of the group, one could say that "humans are a cancer of the earth". If you google this sentence you will get many hits!