In the story on which the film is based, Johnny One-Eye is a cat rather than a dog.
The lines that the stranger quotes to Martin, "the poor Dog, In life the firmest friend / the first to welcome, foremost to defend", are from 'Epitaph to a Dog' by Lord Byron.