Is the word "beg" used in the same way in the following two sentences?

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

I begged for her to do it.
the same meaning