Can the 2009 Mac mini work with its optical drive removed? I wonder if the Mac mini 2009 needs the optical drive for work, or if I can just remove it?

I don't need it at all and have an external drive just in case. I will replace the HDD with an SSD and want to keep the Mac cool and lower the energy consumption as much as possible.
No it does not. Many have swapped out their internal DVD-ROMs on favor of installing another bay that can handle an HDD/SSD.

Here's an example of an optical to HDD bay: http://www.ifixit.com/Apple-Parts/12-7-mm-SATA-Optical-Bay-SATA-Hard-Drive-Enclosure/IF107-081