why don't you ask them if they would mind. If it is being painted with a preservative than they will probabaly agree as it will make the fence last longer.
As well as being their property, if it is their fence, it should be entirely on their land. Therefore you shouldn't paint it without their permission. It could be construed as trespass and criminal damage if done without permission.
It all depends on who has to maintain the boundry, even if your neighbour put up the fence your deeds will tell you who has a legal right to maintain the boundry if it is you then yes you can paint it if not then ask first
You are not legally allowed to do anything to your side of a neighbours fence, if it's on their side of the boundary, without their permission...Unfortunately, the only other alternative is to erect your own fence, o your side of the boundary ...you can the do what you like to it.