If your cold is not too severe and you can concentrate then yes you can drive with a cold.
I've driven when I had a cold a lot of times and I was okay with driving.
However if I had a severe headache or felt dizzy from the cold or was really weak from the cold virus then I would stay home and not drive.
If you feel dizzy, are weak and cannot concentrate then do not drive because you could get into a serious car wreck which can injure you, kill you or injure or kill someone else.
If you need to go somewhere and have a cold but are not feeling very good then have someone drive you so that you stay safe.
You can always take a Taxi or Uber if one is available or other public transit.
Most cold viruses will resolve on their own within a week to 14 days but if not go see a doctor although the doctor cannot do much but you may also have some other health issues if the cold virus is not clearing up.