After treatment. I agree that head lice can't swim, but kids do touch heads in swimming pools; so to be safe, I would do the prescribed treatment, and use a fine comb (such as the one that comes with some head lice medications) to comb out any nits (eggs) that may be attached to hair shafts. Once that has been done, the kid can participate in all activities, including swimming.
Anytime. It would be incredibly rare if not impossible for head lice to be passed in a swimming pool. They are almost always passed from direct head to head contact, and less often through use of contaminated hair care items (brushes for example) or clothing (hats, scarves). Lice can't jump or fly, and I'm pretty sure they don't swim either. ;-).