Yes, obviously so! Diagnosing cancer early is one of the best ways to save someone from it. The cancer is there anyway, it's a natural occurrence. The economic activity that leads to and follows a cancer diagnosis is what economists call wealth: the things we do for each other than make each side mutually better off.
All the examples are like that. Nobody wants oil to spill, but accidents are a fact of life. The GDP created by mopping it up on the other hand leads to a cleaner environment, which is another form of wealth.