That all depends on the type of surgery. If you have a knee operation it wouldn't matter much. I've had some major intestinal surgeries where I wasn't allowed any food or water for about ten days. I "ate" through an IV. After that is was soft, easily digested food. Ask the doctor.
You've probably got to come off the anesthesia first, and go into the recovery room. They need to stabilize you, and probably get you into a room where you will be staying. Food is probably the last thing that will be on your mind, when you are in all that pain