If there is a firefox os build for the HTC One M8 in the HTC One M8 forums then i would check the thread and if there aren't any builds in your device forums then you cannot flash anything until someone builds it.
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer? | Terms of Service