no! That will hurt his wee-wee
Well take a pic so we can see what the situation is here you are dealing with. My dog did this on a bush I had and I just piled up some chunky mulch there and he didn't like stepping on that, so he went elsewhere, but he only weighs 5 lbs. How big is your dog? As soon as you see him do that, pick him up and put him where you want him to go, then as soon as he is done, I mean RIGHT THEN, he gets a very small treat, like a tiny piece of boiled chicken or a green bean or whatever he likes. Keep doing that and he will stop peeing on the plants, after awhile he will start going where you want him to as a habit and you can phase out the treats, just petting him instead.