I see nothing that would prohibit it. I don't think it matters where the power comes from, as long as you comply with all the bonding, GFCI, and other requirements. If you need supporting evidence, I note that 680.23(F)(1) speaks of branch circuits that supply pool-related components, and mentions the possibility of the circuits being "installed within buildings." From that, I think we can infer that the panel is inside a building, and that that building might be an "out building."