No. Energy generation is a very difficult thing in that entire grid must stay within certain tolerance levels. We're talking about gigawatts per hour, so your swimming pool would have to be a size of a large lake or two and would obviously not be worth the cost.
Or you need a lot of small swimming pools. My water boiler uses so called "night current" which is sporadic excess electricity sold at a discounted price. (I live in Hungary.)