This is probably true, however you absolutely can out-train all but the worst diets, if you’re crazy/fit enough. It would mostly happen through cardio, HIIT, and sports however, not pure weightlifting.
If you were to play two hours of full court basketball a day (with intensity, not walking up and down the court), and combine that with a weightlifting routine, you could probably eat whatever you want without gaining much weight. The problem is most people’s bodies would break down with that kind of activity level.