Currently, no. Raids and Attacks are a couple of the reward options available to players when they open Chests, therefore, there is no way to disable or opt-out of them.

For the least amount of impact as a result of Raids and Attacks, we recommend spending your Acorns to grow trees before closing the game.