Yep, except the "scratch" one has a slightly negative connotation of doing something just because the other one will do something in return. The Spanish phrase is a bit more positive.
http://eifuku.co.uk/etymology.htm#You%20scratch%20my%20back%...
Floggings in the Royal Navy were done by the bosun's mate, not a random crew member. The bosun and the lieutenants would watch carefully for favouritism. There was no rancour directed towards the mate because everyone knew he was just doing his job.
This (below) attributes the phrase to Montaign:
http://www.phrases.org.uk/bulletin_board/6/messages/289.html