You need both exercise and nutrition. Doing one without the other is pointless.
Think of yourself as a machine. You need a certain amount of energy to run the machine’s normal operations (breathing, circulating blood) and then a certain amount more to do daily things, like walking to work or serving people at a bar. You get this energy from two places: food, and your energy storage units also known as fat cells. To gain weight, you eat more than you need to in a day and/or expend less energy, the remaining energy gets stored as fat. To lose weight, you eat less than you need to and/or expend more energy, and your body starts to burn its energy reserves to meet your energy demands. It’s as simple as this.
By exercising a lot and not watching what you eat, you are burning energy but then putting it right back on, resulting in a net gain or loss that is negligible. If you aren’t going to eat healthily, there’s no point in exercising. That doesn’t mean you can’t have dessert anymore, that just means you have half of your normal dessert portion and a cup of water. Within a few weeks of eating like this, your body will adapt.