Fog is an interesting weather feature. In simplest terms, it is a cloud at ground level. That shouldn't be scary or ominous. Most people remember times when they looked up into the sky and imagined various shapes being displayed by a cloud, yet when that cloud is at ground level and obscures visibility to practically zero, fog can be scary. This is especially true if a person is in a new location. You can't see through it to give yourself a decent set of bearings, and the fog has the tendency to deaden/dampen sound enough to where feelings of confusion and claustrophobia are not uncommon. The world feels cramped, and everything looks and sounds different.
Readers see both Huck and Jim panic when the fog descends on them, and they get separated. I think the fog can be symbolically related to Huck's confusion about what to do with and about Jim in general. It's not uncommon for a person to express their lack of strong, coherent thought by saying that their head was "in a fog." Huck's head is frequently in a mental fog with doing what is right. Turning Jim in is the right thing to do by societal rules. Keeping Jim safe is the right thing to do by Huck's own moral compass. The literal fog caused confusion that mirrors the confusion and fear that Huck is forced to battle throughout the story regarding Jim's fate.