It's not uncommon to be unable to pee after general anesthesia. It's called POUR (Post Operation Urinary Retention) and is pretty common from what I've gathered. Having been there several times, this is what happens.
For a number of hours before surgery, you are not allowed anything to eat or drink. This is partly so you don't puke and likely so your bladder doesn't get overfull during surgery. One is offered a chance to pee before surgery. I don't think catheters are routinely inserted either before or when you are put under for surgeries lasting under several hours. At least I've never been cathed that way.
Frankly, I'd never want to be cathed with either a local anesthetic or while under general. Pain is a warning not to be ignored. Not all nurses are experts or are gentle.
After you are awake from the anesthesia, you get to pee... if you can. You may well not be able to. In this case, your bladder will likely get scanned to see how much pee is in you. If it's less than 300 - 400 ml, they won't cath you because of the risk of a UTI. There is a non-zero chance of getting a UTI with every cathing. They generally wait until the scan shows about 600 (sometimes more) of pee in you before cathing. BTW, scanning for pee is a quick, painless, and completely non-invasive procedure. There are videos on YouTube.
If the scan shows you are retaining enough pee and still can't go, they may opt to wait a while or cath you with and in-and-out or perhaps put in a Foley for a while or overnight.
Generally, having a catheter should not hurt going in or coming out or cause continuing discomfort. Improper insertion, lack of lubrication, and UTIs can cause discomfort.