Good question.
I actually had a bunionectomy (removal of bunion) two days after I started MF. Then, the next week I had another surgery to fix something on the foot. I asked my doctor's office about doing a diet, and they said no problem. Granted, when I at Nutter Butter's and had apple juice when I woke up...not quite on plan, but it was wonderful
I've been at home with my foot propped up for 2 weeks now. I have to say, it is really nice that I can just pop out a meal (aka, bar) without much effort and torture to my foot. The only problem was having to pee so much from drinking a lot of water!
Gall Bladder surgery is different than foot surgery. I would talk to your doctor about what you are doing. Ask if you can continue, if not, what can you do to stay "close" to plan and then when you can return to plan. If you have a coach, you could ask them. You could also call MF or post on their Nutrition Support site and ask too.
Good luck with your surgery!!!