Should a PhD student use his academic affiliation for his publications which are not related to his thesis? If a PhD student is working on a research project which is neither related to his thesis topic, nor supported by the university in which he is studying or a faculty member; Does he have the right to use his academic affiliation and contact email?

There are two points here, 


If the student is using the university facilities, he may acknowledge that support in the Acknowledgement section of his paper not by using the university affiliation. 
The university in which the student is studying in doesn't necessarily want to be associated with whatever research he does in his free hours.


P.S.: Does this consideration apply to the researchers who work in a research institute or company?
Yes.

The affiliation serves two purposes: acknowledgement and identification.

Even if it is not part of your thesis research, if you are receiving resources of any kind from your institution, you should list them as your affiliation.  These resources include money (whether directly related to your research or not), computing equipment, internet access, printer access, electricity, phones, faculty and student colleagues (whether coauthors or not), library access (either physical or electronic), whiteboards, local coffee shops/bars, and the general intellectual atmosphere that encourages you to do research in the first place. You can afford to be generous.

Also, the affiliation helps identify you as an author, especially if you have a common name, or you publish other papers with the same affiliation.