I agree that you can't out-train a bad diet.
That said, I think you can get away with some junk here and there, though like The Scientist, I would also be curious as to what you're calling junk.
Though there's more to it, the most basic idea in losing weight is a calorie deficit. So, if your junk brings your total calorie intake to or above your caloric requirements, you won't lose weight. The problem is when you eat normally, then add junk on top of it.
What I do is compensate. If I know I'm doing something that may result in me eating some junk, I'll just eat less in other meals for that day. So my total calorie intake isn't overly high.
Just yesterday I read an article from a couple of years ago, where a guy went on a "Twinkie Diet". He ate almost nothing but junk (twinkies, cookies, cupcakes, etc., but with one protein shake per day) for two months, and lost 27 pounds. He did this by making sure he was in a calorie deficit. I think he's a nutrition teacher, and he did this as an experiment to prove the point that it's all about calories in vs. calories out.
Now - this is NOT the way to do it - but it shows the importance of calorie deficit when trying to lose weight.
And I would also say that the "Twinkie Diet" guy probably didn't end up in great shape from that diet. Due to it being almost all junk carbs, he probably didn't feel great, probably lost strength, lost muscle tone/mass, etc. (if he had any to start with).
If you are training, trying to be in fair shape, look good, etc., then the majority of your calories will need to support that. So, quality protein, healthy carbs and fats. If you're meeting your requirements in that department, I don't think occasional junk food is going to be detrimental. But of course, the cleaner your diet is, the better your health/fitness/strength will be.