|MadSci Network: Chemistry|
Trivially, the answer is ‘yes’. Take a typical bit of poly(ethylene) plastic film - it will keep water in, but let through petrol (gasoline) with great ease. Unfortunately, you will not have a film left at the end, as it will have dissolved into goo.
What you need is a chemically-crosslinked material, which instead of being countless little molecules is essentially one big molecule. In this case, when exposed to a liquid which would usually dissolve it, it would only swell, allowing that liquid ‘through’ (depending what is on the other side). This chemically-crosslinked material could be one with an affinity for oils (e.g., poly(styrene-co-divinylbenzene)) or for water (e.g., poly(acrylamide-co-methylene bisacrylamide)).
Only letting water through and not letting anything else through is not absolutely achievable, though in practical terms you might well get an adequate amount of separation, depending on what your water is actually mixed with.
One problem is that if your two liquids are chemically similar enough to be mixed together, they will tend to be chemically similar enough to both swell the same kind of membrane... and if they aren’t mixed together, there is usually a better way to separate them!
Try the links in the MadSci Library for more information on Chemistry.