Cancer can affect the nail bed in several ways. Certain types of cancer, such as melanoma, can originate in the nail bed. Additionally, systemic cancers can cause changes in the nails and nail beds due to the body's response to the illness or as a side effect of treatments like chemotherapy.