Of course the logical answer is that ex-spouses should co-parent their children. They should keep the lines of communication open, ask each other advice in certain situations and keep any disciplinary action going whether they're with mom or dad.
If that cannot happen, which is very common these days, the only thing you can do is to teach your child your own morals and values and stick to them. Explain to them that dad/mom has different rules but in your house this is how it goes. Ultimately you want to be able to work together as parents, but if that's not a luxury of yours, stick to your guns.