It's pretty useless to talk about "cancer" as one thing. Many cancers do not "care" whatsoever about any of that. Even among the ones that do, I would be careful not to imply you can know anything new about a person by finding out they have a specific type of cancer. For one, it's almost always a statistically unwarranted leap, and second (more importantly), it makes you sound like a monstrous asshole.
Yes, cancer is complex. But in general it seems well established, that way of living does influence chances of getting some cancer. Apart from that, no concrete judgements were made.
And the "monstrous" post above was not at all about that, but about "sacrificing health for money, then sacrificing money for health, but never finding peace in the now".
General life advice. No one said as a general statement, "if you have cancer, it is your fault".