I bother my terrier cross, Oliver, occasionally--tugging very lightly on his beard, rolling him over, that sort of thing--but to be fair, he gets to mouth me back then, and if he moves off I don't follow him, and there's always quite a bit of petting mixed in (ex. if I roll him over, I scratch his belly a bit; if I tug a bit at his beard, I'll scratch behind his ears in a moment). It's a bit of a game with us. *shrugs* If I get very upset, I tend to chase him round the house, not hit him, which he absolutely loves, and it works to work off my energy as well. Or play tug-of-war; that's satisfying to both of us as well (even if he recognizes the futility of the exercise--I'm three times his weight--and tends to just lie down and let me drag him round the house). If you're going to work off frustration with Fido, figure out a way to do it that's fun for the dog as well--rough play is, to my mind, much more satisfying than hitting. Just make sure the dog has very good bite inhibition if you go that route.
I hugged too tightly too when I was little. Then I realized that I was driving the JRTs I grew up with to not want to be around me (understandably), and realized that stuffed animals are better to hug tightly and dogs are better to snuggle with or lean on.
I like using Oliver's belly as a pillow occasionally, for example. (He's about forty pounds; I'd never do that with a smaller dog, and he doesn't seem to mind.) Dogs hate hugs, actually, so although I like giving them, I always scratch Oliver's back (which is his favorite spot) when I do so, which makes them more palatable to him, and I never hug him tightly.
If you aren't actually hurting the dog--punching, but pulling it so that you're just touching him, not actually doing anything--I don't see much harm in it. The only effect I can see to that is that you'd desensitize the dog to sudden quick movement, and that's not really a bad thing, especially with a nervous dog.
Other outlets are also good. As sociable_hermit suggested, taking up another sport might be a good idea so that you aren't keeping the dog as your only outlet for your energy.
_________________
cogito, ergo sum.
non cogitas, ergo non es.