As long as your cold symptoms are only mild and not severe and you have no fever then yes you can get a flu shot while having a cold.
If your cold symptoms are severe and you have a fever accompanied with the cold then you won't be able to get the flu vaccine.