Is it possible to publish a paper when the research was done many years earlier? Is it possible to publish a paper when the research was done a number of years ago? 

For example, can I write a paper from my Masters thesis which was done in 2011 and try to publish it in 2017?
Yes, IF the research is still relevant and novel. 

When you publish a research paper you never write when was the research performed, you merely describe the research and explain why it is relevant. If the research is still a new/different method, then it doesn't matter when you did it. No one is going to ask. If the method was novel then, but now several people have published about it and you can not add anything to the current literature, then it is not worth publishing. 

Just follow the same criteria that you would use if the research was done last night to consider if its worth of publication.