The answer is yes. And not only is it legal, but purchasing the equipment for rainwater collection is tax free!
Texas lets people buy rain harvesting equipment free of sales tax, and it’s against the law for homeowners’ associations there to prohibit rainwater collection. A few states in the western U.S. have traditionally outlawed rain harvesting altogether. The reasoning is that rainwater eventually makes its way into streams, rivers, and other water sources to which various individuals possess legal claims. In many cases, those claims go back generations.