Like all good questions, this one is best answered by opening with ‘it depends’.
If you are new to training then it is possible to gain muscle, as your body starts to adapt to the new demands placed on it, and get shredded, as you burn more calories than ever before, at the same time.
Unfortunately, these twin benefits of training can’t run together at the same time forever (or everyone would have the body that they want!).
The longer you have been training for the more selective you have to be with your goals. If you want to get leaner then you may have to stop gaining muscle, or even lose some, while to gain mass you are going to have to be in a calorie surplus for an extended period of time, so your abs may go into hibernation for a while.
So, to summarise, if you are new to CrossFit then you may well experience “newbie gains” where you add muscle and strip fat simultaneously for a while. But the longer you train for the more you’ll have to focus on one or the other to really move towards your goals.