The short answer is yes, but…
You knew the “but” was coming so here it is. But it’s very, very, very difficult to lose weight through exercise alone unless you’re working out at a fairly high intensity for hours a day. The reason for this is that you can burn only so many calories through exercise and typically the more you burn the hungrier you get so you may end up pretty much right where you started.
I used to train beginning marathoners who were all excited about the weight loss prospects of running long distance. Now don’t get me wrong. They did train hard and they would occasionally burn upwards of 1,000 calories during a training session, but then they would go out and have a couple of beers, some fries, and a piece of cake and lo and behold that caloric deficit suddenly became a surplus. You can easily wipe out a hard workout through mere minutes (seconds perhaps) of unhealthy eating.
That said, exercise is an enormous part of a weight loss plan, but it needs to be coupled with major dietary changes. And obviously if you want to keep the weight off you need to keep exercising and keep eating healthfully for the rest of your life.
It’s not complicated, just hard!