It totally depends on the situation. Depending upon both of your positioning and distance, you can gain or lose advantage by striking the guard. (I'm going to presume we're talking about boxing because that's the most restrictive case, and for all other striking combat sports, you can expand your options from there.)
Where is your balance as you are moving into this strike? If you are very extended, and your jab just barely reaches his guard, and he is balanced, you have given the initiative away.
If he is moving towards you, and you can throw a strike that hits his guard so hard that it twists his upper body out of position and simultaneously allows you to stay planted over your feet, then that's good. Maybe while he regains his balance, he's moving his hands away from protecting a certain part of himself and you can strike while he readjusts.
A lot of times people hesitate a little bit while they're taking blows, so maybe you freeze him for a second while you keep tapping away so you just use that to kind of stay on offense mode while he has to play defense, hoping not too much gets through. If he doesn't break that range--and you're staying in your strong offensive range, you can just kind of keep your gloves drumming on him until he f's up and misses a block. Just don't let yourself get set up for a counter. It's all about where his upper body is, in relation to his feet. You just gotta watch that and press the advantage when he's out of position or getting flustered, and don't press it when hitting his block would leave you out of position.