All dogs and cats, purebred or not, have the potential to develop cancer during their lifetime. However, it is true that some purebred animals are more susceptible, on average, than others.
Among dogs, two of the sweetest breeds are unfortunately highly susceptible to multiple types of cancer. Those breeds are the Boxer and the Golden Retriever. Several other breeds are predisposed to certain forms of cancer as well. For instance, large and giant breeds of dogs such as Bernese Mountain Dogs, Great Danes, and Rottweilers are more likely than other breeds to develop bone cancer. For a more thorough list, you can click on this link from the Morris Animal Foundation (PDF format).
Mixed-breed dogs (sometimes known affectionately as mutts) are generally at lower risk of cancer than their purebred counterparts.
Among cats, less breed-specific data exist on cancer risk. However, purebred cats are generally believed to be more susceptible to cancer than their non-purebred cohorts. In my experience, Persians, Bengals, and Siamese cats appear to suffer from cancer at increased rates. As well, cats with white faces and ears are prone to a type of skin cancer called squamous cell carcinoma. In these cats, the cancer develops on the head and ears, and exposure to sunlight increases the risk.
Please remember that cancer does not universally occur in the breeds mentioned above. Plenty of Golden Retrievers and Persians never develop cancer. Also, remember that cancer has many risk factors, and breed is just one of them.