I would be concerned if this is a pattern: eating something "bad," then trying to exercise off the calories. First off, it doesn't work that way. Secondly, that can lead to exercise bullemia ("binging" on the "bad" food," then trying to "purge" with exercise).
Fitness isn't what you do once in a while, it's what you do consistently. If you are consistent with good eating and working out, then an occasional treat won't have much effect on your results.