It is possible, but it is very difficult to do...everything has to be on point 100%. Most people can not do it, and even if they can, for long term goals, you are better off trying to achieve one thing at a time.
According to Burn the Fat/Feed the Muscle and a few other books I've read, it is physiologically impossible to burn fat and gain muscle at the same time. If someone does do this over a period of several weeks, they probably gained muscle for a week or two, then lost fat for a week or two; zig-zagging back and forth. Some probably gain muscle for a day or two then lose fat for a day or two.
I've done that myself, where I plan on bulking, realize how much fat I've gained, freak out, and started cutting. Once the fat was under control, I would get upset at how small I was and start the process again.
I'm only in my third year of using the bulk/cut method and I am really happy with my improvements.
You can either restrict your calories a lot and lose fat while not gaining any muscle. You can restrict your calories a little, creating a small calorie surplus which would cause you to make some gains in muscle and not gain any fat. Or the third option is to have a large calorie surplus, which is the only way to be sure you are maximizing your gains.