The water itself is identical; the samples are not. Once each sample is purified, every one of them is the same compound H₂O, with hydrogen and oxygen combined in the fixed mass ratio 1 : 8 — that is exactly what the Law of Constant Proportions says.
What differs is everything the water is carrying with it:
- River water — suspended silt, dissolved oxygen, traces of organic matter.
- Borewell water — dissolved calcium and magnesium salts (this is what makes water “hard”), sometimes iron or fluoride.
- Sea water — about 35 g of dissolved salts per kilogram, mostly sodium chloride.
- Rain water — dissolved carbon dioxide and other gases from the air.
So these are mixtures, and a mixture may have its components in any proportion. Distil any of them and what comes over is pure water — 9 g of it will always decompose into 1 g of hydrogen and 8 g of oxygen.