We have never, even as a proof of concept, been able to develop a closed system capable of supporting mammalian life separate from earth's ecosystems. We assume it's possible based on no particularly rigorous evidence and in spite of our numerous failures to even come close. "Mars as backup" is not a credible plan based on science within even our optimistic grasp.
The technology & social systems capable of doing this would be incredibly valuable long before any permanent mars settlement became feasible so if we can do it we should and then we can see.