I've heard from people that you can have sort of a problem if you don't – something called "blue balls."
Sure, it's okay not to masturbate, if you're able to. "Blue balls" is a common term for a rather uncomfortable congestion of the blood in the scrotum when you're sexually aroused for a while and don't ejaculate. The condition, while not very pleasant, is harmless and goes away in a few hours. However, anytime you have "blue balls," you're likely to be so aroused that resisting masturbation in difficult.
If you go for long periods without masturbating, your body releases semen in nocturnal emissions, or "wet-dreams." No harm will come from not masturbating, just as no harm will come from masturbating; either way is fine with your body.