Entschuldigung
is an apology, an expression of regret as in :
Entschuldigung , ich sollte das nicht tun .
It could be an excuse ,a reason or explanation put forward to defend or justify a fault or offense as in :
Entschuldigung , das habe ich aber nicht so gemeint .
An exclamation in the sense of 'I beg your pardon "as for example in the form of a request to a speaker to repeat something because one did not hear or understand it as in :
Entschuldigung , ich habe dich akustisch nicht verstanden.
Tut mir leid or es tut mir leid
this is more a form of expressing sympathy with someone ." I am sorry " kind of equivalent .
Es tut mir leid, er war echt ein netter Kerl .
Otherwise when the meaning is comparable with 'Entschuldigung' , it will be more of an excuse or a reason or explanation put forward to defend a fault or offense :
Es tut mir leid , aber ich schaffe es nicht bis morgen.