Dogs can live several years after complete removal of some malignant mammary tumors. So once a mass is found, having surgery to remove it earlier is better. Mammary tumors can be largely prevented by spaying before 6 months of age or before your pet's first heat cycle.