Keiva, you are nearly spot on it with your speculation. an alternate view is that the original form was dog on it, to be compared with pox on it.
1826 J. Wilson Noct. Ambr. Wks. 1855 I. 260 Dog on't, ye wicked auld Lucifer, hoo your een sparkle as you touzle the clergy. 1872 C. King Mountain. Sierra Nev. v. 101 ‘Take that, dog-on-you!’