Yes such conditions in the marriage contract are permissible. The wife can stipulate in the marriage contract that she does not need his permission to leave the house whenever she wants to. As for the husband not teaching her religion, sometimes if she does not know important religious matters, it’s obligatory for him to teach her and guide her, so they cannot put such a condition.
Yes, the default conditions Allah has put are the best for us, but he has allowed us to put our conditions if both sides agree on them. The hadith states any condition is ok as long as it doesn’t violate or go against the Qur’an.