It's unclear, but it's generally terrible for your survival odds.
The American Institute for Cancer Research states quite bluntly that
While underweight men and women have higher overall mortality rates than people of normal weight, this association is not seen in deaths resulting from cancer. In fact, rates of death from cancer among the underweight are not any higher than among people of normal weight. That said, some factors associated with being underweight can and do raise risk for certain cancers. Current and former smokers who are underweight have a higher risk of lung cancer. A diet lacking in basic nutrients can impair immune function and raise risk of several types of cancer.
Notice the difference here between a risk of cancer from being underweight and a risk of cancer from other factors that can cause a person to be underweight. The two are vastly different things.
Being underweight can lead to a higher mortality rate (see, for instance, Ringbäck et al. (2008), Katzmarzyk et al. (2001), and Visscher et al. (2000)). However, this encompasses death via a variety of diseases, not just cancer. The jury is out on this, with some studies finding no correlation (Flegal et al. (2007)) and some studies finding a possible inverse relationship between BMI and cancer at some ages (Maasland et al. (2015), studying the risk of head-neck cancer).
Regardless of the effect of low BMI on cancer risk, being underweight can drastically reduce your odds of survival if you do end up getting cancer.
- Matsunaga et al. (2015): Underweight patients had a higher risk of cerebrovascular or pulmonary complications and mortality after surgery or related procedures for lung cancer while in a hospital. Often, their risk levels were twice as high as those for patients of normal weight or overweight patients.
- Migita et al. (2015): Underweight people undergoing surgery for gastric cancer had a five-year survival rate of 66.6%, compared to 81.3% in people with normal BMI and 79.9% in overweight people.
- Zogg et al. (2015): The risk-adjusted outcomes for underweight patients undergoing treatment or surgery for a variety of cancers "consistently were worse" than risk-adjusted outcomes for patients of normal BMI.