I had a great marriage for 15 years. Religion was not part of our marriage. We had a non-denominational ceremony by a judge. He knew I was an atheist, he a recovering JW. Five years ago or so.. one of his friends invites him to the shooting range, then men’s study group... then it becomes all out war on me and the kids. We are the devil, going to hell.. blah. He became very verbally abusive. Some christian!! I’m so glad for us to be out of that mess as I my youngest is an Atheist and my eldest is more Agnostic.
Carin said it well - sure it can work so long as both are not rabid . I don't give a rat's rump what anybody else believes so long as they keep it to themselves as I do , keep it to myself.
I think it is more likely to work between individuals who are closer to the middle rather than the extremes because differences between them are smaller and easier to find common ground upon. In contrast, if you took someone like me (an absolute atheist) and put me in a relationship with a religious zealot, it would be very hard to remain civil amd respectful for long, and would absolutely explode when you add family and parental indoctrination of children into the mix.