I'm Bangladeshi but for my profession currently I am living and working in Malaysia. My girlfriend is from Spain. She wants to move and live in the UK. I know there is no problem for her to work and live in the UK but as I am non-EU citizen I can't live and work in the UK. If we get married in the UK, can we live and work there?
Yes, but it's not just a case of turning up and working. There's process, of course.
People who are married to, or in a civil partnership with, an EU citizen are eligible to apply for an EEA Family Permit.
Note, however, that your spouse must be living and working in the UK as well (sounds like you've got that covered), and you must live together, AND you must travel to the UK together (or she should already be living there).
There are a few other small details, but it's the EEA Family Permit that would get you there. If you're at all uncertain about doing the process yourself, an immigration lawyer would be a good idea.
We also have a related question on the process for doing this.