There is no actual regulation to say you can't run it along a fence, although the cable does have to be protected so SWA is the way to go. Also, the fence does not have to be of "substantial structure", so it can be wooden.
There is, however, guidance to say that outside lighting must be...