yes it can be a problem. most people having surgery are told to be npo (latin abbreviation for "nothing by mouth") so that would include coffee water and food. you are wise to follow your doctor's instructions since aspiration of stomach contents during intubation can lead to an aspiration pneumonia. coffee contains caffeine. caffeine may be chemically incompatible with the type of anesthesia you may be getting.
being intibated for surgery in 6 hours. would a cup of coffee hurt me right now?