The most common notion is that vaccinia virus, cowpox virus, and variola virus (the causative agent of smallpox) were all derived from a common ancestral virus.
Scientists have not determined exactly when the change or mutation occurred, but the effects of vaccinia and cowpox virus as vaccine are nearly the same.