TL;DR Yes, that will work. It may not be practical, but that is a separate issue.
There are two measurements routinely used for cooling in the US:
- BTU = British Thermal Unit = heat to raise the temperature of one pound of water by one degree Farhenheit
- Ton = 12,000 BTU per hour
Why 12,000 BTU per hour?
A ton is the amount of cooling you would get from one ton of ice! A ton is 2,000 pounds. It takes 144 BTU to melt one pound of ice. 144 * 2,000 = 288,000. 288,000/24 hours = 12,000 BTU/hr.
Even though modern systems are based on transferring heat in very different ways, the terminology, based directly on the cooling provided by melting ice, remains.
Back to the practical problem:
In the olden days, the ice came from elsewhere. There was an industry that for many years would make ice in bulk and deliver it for cooling purposes - particularly for home refrigeration. It wasn't that long ago that some people would refer to a modern refrigerator as the "ice box".
However, if you produce the ice inside then you are really just trading energy. You take heat out of the water to make the ice, and put that heat into your house. Your net gain of cooling is zero - actually worse, because your freezer isn't 100% efficient. An actual air conditioner sends the hot air outside.
Plus, the amount of cooling you can get this way is minimal. A small window air conditioner might produce 5,000 BTU of cooling. Run 24 hours a day, that would be equivalent to melting 833 pounds of ice! Running it just 2 hours a day (intermittently during the hottest part of the day) would be equivalent to 69 pounds of ice - that's more than 8 gallons of water.
In addition, water from the air will condense on your ice containers as they melt. That lowers the humidity (which is good) but the water has to go somewhere or else you will have a mess. In an air conditioner this is called condensate and every air conditioner has a system (sometimes just a simple drain pipe, sometimes involving a pump) to handle it.