The word fog actually comes from its adjective, foggy, which in turn comes from the original noun: foggage.
In linguistics, this phenomenon is called back-formation. Other words that were formed this way include diplomat (from diplomatic) and pea (from pease).
Sources: