When someone thanks you for doing something, all three phrases are appropriate responses; "It's a pleasure.", "It's my pleasure." and "With pleasure." When used in this way, there is no difference between them. For example:
"Thank you for teaching me English."
"No worries, It's my pleasure."
If someone says, "I beg your pardon.", it usually means, "I'm sorry, I didn't understand you." or "I'm sorry, I didn't hear you." In that case, you can repeat what you said, "I'm sorry, I said....."
If someone says, "I beg your pardon." and they seem offended, an apology or explanation is appropriate. For example, "I didn't mean to offend you. I was just trying to....." or "I'm sorry, I just wanted to know.... I didn't realize that was offensive."