I can't speak for the code, but...

I advise against it, because I currently have a customer whose pool apron covers a bad wire run. Since UF was used, replacing this wire is almost impossible to replace this wire, without tearing up the apron.
Also, im my experience, trenches are NEVER deep enough, and UF is almost always run way too shallow.
Run pipe, then transition in a ground box once past the apron area.