Does the word "beg" have the same definition in the next two sentences?

I beg your pardon. I didn't mean to cause offence.

He begged her to go to the prom with him.
the same meaning