It is generally illegal in Australia. If you own a farm you don’t own the water which falls on your land. You must allow it to join a watershed for use by others.
Of course this doesn’t really apply in metropolitan areas where collected water is of less value due to pollution.
I read that in Melbourne, water tanks were initially made illegal when reticulated water became available and few people used it because tank water was cheaper. Then more recently tanks were legalized well after they had been unofficially condoned by government and about five minutes before the same government started subsidizing them.