DH & I grew up in basically the same kind of households, grew up in the Baptist faith, & went to conservative private schools.
We got married youngish (21 & 22), so both our political & religious views have evolved & grown over the years. While we started out probably exactly the same politically & religiously, I have probably grown a little more liberal than he has. However, we both have become less strict & less "black & white - this way's right/this way's wrong" about things.
We both still vote the same way (and, yes, we tell each other for whom we're voting), because there are some issues for which we're voting for or against, regardless of the candidate, if that makes sense, & the issues that are important to us lean us toward one party over the other.
So I honestly don't know if I could have a relationship w/ someone who was completely opposite me politically or not. I'd like to think I could, but I also think there are some moral/ethical issues that go beyond politics but end up being platforms. And I'm not sure I could compromise on those issues.
But, like others have said, I think the key is handling the different issues w/ respect for the other's opinions & feelings & not assuming everything about a person just because he/she is of a certain political persuasion.
And I think limiting yourself & your relationships to only people whose beliefs & politics exactly align w/ yours is doing a disservice to both yourself & the other person.
I know the current climate is to "defriend" anyone who may have voted differently than you, but that just seems so limiting & counterproductive to me. The way we come to any kind of mutual agreement is through respectfully listening to one another & learning about each other's different views. The world was not made to be one-sided, & we become so much more layered & nuanced as people when we take the time to listen to & learn from other views that may be different from ours. And, in relationships, I would think 2 people having different views & beliefs, but being respectful of each other, would only make the relationship more richly layered.
That said, religion for me would be harder. I knew a guy in high school, & he liked to be opinionated & argumentative about everything just for shock value really. He's been married now for over 20 years, & he & his wife have a child. When he & his wife were first married, they were both the same religion & held the same beliefs. Within the last few years, he's changed his core beliefs. As his wife, I would have a hard, hard time w/ something like that. You get married thinking one thing about a person, &, years into the relationship, the person completely changes & starts believing differently than you. That would be hard.