I once heard this explanation of the expression:
A British sailor was, many years ago, in a port in Scandinavia. He decided to attend a service at a church there, but it was all in Latin, which he could not understand. At one point, the priest intoned 'Ah, mihi beate Martin', which was all that the sailor remembered when he was later asked, by his shipmates, about his church visit. 'Blowed if I could understand it,' he said. 'It was all my eye and Peggy Martin.'
My mum & Nan, both born & bred in Sheffield, often used this phrase, as do I, & as I understood, it originated in Sheffield. No one I've said it to, outside of the City, has ever heard of it. My Nan was born in 1896, my mum in 1925 so it's been around a while