Green’s Dictionary of Slang

dag n.3

[late 19C+] a euph. for God, usu. in combs. e.g. dag on, dag gone, dag-gum, dag nab.