DICE: Domain-attack Invariant Causal Learning for Improved Data Privacy Protection and Adversarial Robustness