I've read that in order to burn fat you must be in a caloric deficit, while to build muscle you must be in a caloric surplus with a focus on proteins.

If I eat my body weight in protein while being in a caloric deficit can I burn fat while building muscle?

Is it possible to do both at the same time? If so, how?