Earlier quoted context omitted.
Hmm.. I tried to execute "export MOZ_USE_XINPUT2=1" in the terminal and then start FF from the GUI and it did not have an impact. So I guess it would also not work in .bashrc. But not sure.
No that's not how that works. Environment variables are inherited from parent processes. If you just put that in a sibling process (like a terminal), it won't run firefox with that variable if you run it from the GUI. Your .bash_profile allows you to set up the environment for your entire session.
I'm afraid each desktop environment probably has its specific way of adding environment variables.