Was The Department of Homeland Security created because of domestic dangers during World War 2?

Negative. The Department of Homeland Security was created after The September 11 attacks.