For practical reasons most EU countries want to be in compliance with EU law and will often follow ECJ recommendations and change their own laws if found to not be compliant. Also many EU countries have laws that essentially state that all their laws must comply with EU law.
The other option is to apply for an explicit opt out of certain a EU regulation that you feel is incompatible with your own laws.