No.
Fog and viewdistance are different. However, they look similar.
Fog is a real effect in the game. Nobody - humans or AI - can see through it.
Viewdistance is a graphics Option. It affects what you the player can actually see. It doesn't affect the AI. If you have it set low then you can be shot by a unit that is too far away for you to see. However the minimum viewdistance is 500m and it's pretty rare to be shot from further away than that. The default is 900m.
In fog, if you can't see him then he can't see you. Except that sometimes the AI can see a little futher than you can. ;D Which is offset by the times that you can see each other, but he doesn't notice you.
Obviously the distance you the player can actually see is the lower of fog and viewdistance.
Examples:
setViewDistance 1500
180 setFog 1