Benign Overfitting in Out-of-Distribution Generalization of Linear Models