The answer is, yes and no.
If you lift heavy weights, train hard, eat well and be smart with supplements, then you will be on your way to adding muscle. Throw in some fat burning workouts and you'll drop a little bit of fat too. Sounds good right? Not as good as you think.
Whilst you can do both at the same time, you won't be able to maximise each method of training and diet to it's fullest. That's why the most common way of doing it is to 'bulk up' first whilst trying to keep body fat levels down, and then perform a 'cut' to reduce body fat. When you go on a 'cut', for every 4lbs or so of body fat that you lose, you'll also shed around 0.5lb - 1 lb of muscle, so you can't lose just body fat on its own, which sucks!
What you can do however, is stretch the training out over a longer period of time (8 months or so) where you can manipulate your training and diet. You can spend a bit of time on a 'bulk', then focus more on shedding body fat, then back to 'bulking', and so on. This way you are training for both goals, but you have enough time to do it effectively. Some people do use this method, but I would still say the traditional 'bulk then cut' is the most popular. When you're at a very low body fat percentage ('stage ready' for example), then it is easier to maintain a lower body fat level from then on.
As you have to be in a calorie deficit (consuming less calories than you're using) to shed body fat, then you can't also build mass, where you need to be in a calorie surplus (consuming more calories than you're using) in order to do so. Many people hope that there is a way where they can get 'jacked' like Dwayne Johnson and also strip away body fat, and it's just not possible to do both at the same time. The one issue with a typical 'bulk' is that many people tend to be a lot more lenient with their diet and end up gaining more body fat than they want - which simply makes the 'cut' a lot harder. You can 'bulk up' by eating healthy and lean, which you will still gain some excess body fat, but it will be a lot less to lose. Weight training both builds muscle and burns body fat, but your diet will determine what one happens the most - eating more will build more muscle, eating less will shed more body fat. It's up to you which one you want to focus on.
Lee Gregory Fitness