Before you place a call there is a backspace symbol to the right of the numbers that you've entered that you can use to delete any of the numbers that you've already entered.
However, once you've actually rung a number and started a call, the backspace disappears and you can't delete numbers (as in your screenshot in the question).
The reason for this is that while you're making a call the numbers that you type in are instantly transmitted down the phone line as DTMF (or touch-tone) signals so that you can navigate through voicemail menus, phone menu trees (eg "press 1 for billing, press 2 for complaints..."), dial extension numbers, etc.
You can't delete a dial tone that's already been transmitted. This is the same as while you're in the middle of one phone call you can't just type numbers into the dialler and start a totally different phone call. So the dialer code that you typed in to try to show your SIM message number wouldn't work because the numbers and symbols would have been transmitted down the phone line as beeps while you typed them (possibly annoying the person on the other end) instead of being used as a "service code" instruction by the phone.