In normal usage, they are synonymous: Y wishes to receive an explanation from X. The second form could also mean that Y wishes X to offer an explanation to Z on Y's behalf.
Here are alternative constructions for your two sentences:
Could you give an explanation to me?
Could you give an explanation for my benefit?