You can work out safely so long as you have only a cold and your breathing is basically unchanged. Flu = no. Cold = sweat it out.
From my own life, I too have seen doing that to help me from time to time. Gives you a little bit more energy. I'm sure there's probably some research to back it up, somewhere.