Of course it's okay!
However, I should say this: it isn't healthy to think of yourself as "going" on a diet. You should think about your diet as part of your long term lifestyle, not something that you can succeed, fail, or "cheat" on in any way.
It is best to concentrate on adding the right foods to your diet, rather than worrying about what you shouldn't eat.
Once you are obtaining all the vitamins and minerals you need (and achieving the correct balance of carbs/fat/protein) from the foods that you eat, you will stop craving food that is bad for you. This process is a lot easier and much more pleasant than it sounds.
I present you with a two part challenge:
1) For one week, eat a box of berries (appx. 10 oz) every single day. I know they are kind of expensive, but if you do this, you will start to notice that junk food doesn't appeal to you as much anymore. This saves most people money in the long term. Also, they are not fully in season yet, but they will still have the same effect.
[Why berries? They are one of the most neglected food items with probably the most benefits. They help with digestion, energy and stamina levels, mental clarity, mood regulation, weight loss, blood sugar regulation, and can even prevent cancer, heart disease, and Alzheimers disease.]
2) If you experience a craving for a food that is junky, do the following:
-Close your eyes for a moment (if you can), and breathe slowly in and out through your nose. Imagine looking at the food you're craving. Look at it very close up in your mind. Wait a minute... what's that? is that grease? Ew... that's kinda gross... Oh well, we'll eat it anyway. *nom nom nom* hmmm... that's not as tasty as I imagined it would be. It's kinda slimy. Maybe if I eat another one, it will be better! *nom nom nom* okay, well that wasn't AWFUL, but it tasted even worse than the first one... and now I feel a little nauseus! (Eat a LOT of them in your head, and really concentrate on the gross feeling you get after eating it.) We crave things because we want that rush of endorphins associated with it. Through visualizations, you can break [or even reverse] this association!
Never feel guilty about eating too much food, it just means that your body is confused and is trying to get the nutrients that it needs. It is always a bad idea to become emotionally attached to our diets (regardless of whether that emotion is positive or negative). It usually just makes the situation worse.
And don't feel bad about getting in that situation in the first place. Food companies make a living out of getting people hooked on junk food. It is a multi-billion dollar industry, and almost impossible to avoid. [But, though conscious eating, you can escape it's powerful grasp without starving or inconveniencing yourself!]
*Make sure not to skip a meal. That slows down your metabolism more in the long run, so your body will just hold on to the next meal it receives. It is best to have 5 or 6 snacks/small meals spread throughout the day.
P.S. What is your ultimate health/nutrition goal? If you elaborate a bit more, it will be easier to provide more individualized advice.
Nutritionist (If you send me an e-mail [email@example.com], I will be happy to give you a new challenge every week!)