You've posed a good one!
As best I can tell, the NEC has no problems with the 'fence' anywhere near the pool, under the pool, next to the pool, even in contact with the pool. As long as it's under the surface, it doesn't exist, as far as the NEC is concerned.
Am I correct in my thinking that the 'fence' is actually an antenna, rather than a circuit, that triggers a receiver worn by the dog?
If so, the NEC might have something to say about the distance between the dog and the pool