Yes, pets can get skin cancer. Tumours affecting the skin or subcutaneous tissue (the tissue just under the skin) are seen in pets. Many such as lipomas (fatty tumours), sebaceous adenomas, and papillomas (mole-like growths) are benign, meaning that they won't spread to other parts of the body. Unfortunately we also see the more threatening malignant tumours (that spread) such as melanomas, squamous cell carcinomas, and mast cell tumours.
A veterinarian can diagnose a tumour in a pet with a biopsy, which involves removing a small amount of tissue from the tumour and examining it closely - or needle aspirate cytology, in which the veterinarian uses a needle to remove a microscopic amount of cells from the tumour in order to examine cell structure. These samples may need to be examined by a veterinary pathologist.
If your pet loves to bask in the sun there is an easy way to help protect them from the suns harmful rays. Apply pet sunscreen - there are numerous sunscreens specifically formulated for pet skin.
Also, early detection is key - keep an eye on any lesions, bumps, or growths on your pet's skin. If you notice any changes or have any concerns, discuss these with your veterinarian.