Supposing someone's anesthesia wears off during surgery, would they feel what was happening?

Yes but differently. Called "awareness under anesthesia", the feeling would range from the much feared everything, which would be rare, to the barest possible glimpse that you are even conscious. Different drugs are used for different effects, so there will probably still be plenty of pain killers in your system if the main drug wears off. If you are worried, tell anesthesiologist: avoid paralytics if possible, ; why.