Does the firm where I have performed my final or doctoral research have the right to publish my master's thesis or dissertation?

If you haven't made any specific arrangement, the right of publication remains with you as author. 
Dissertations and Masters' theses may hold information that requires confidentiality, e.g., if corporate interests could be jeopardized or in view of a patent application. It is therefore important to make the necessary arrangements with the firm before you commence your research.