Douglas Harper's Etymology Dictionary
by 1956, perhaps from bugger off (see bugger (v.)), which chiefly is British (by 1920s) but was picked up in U.S. Air Force slang in the Korean War.
Wiktionary
interj. (context idiomatic informal transitive English) (non-gloss definition: Used to tell somebody to leave one alone.) vb. (context informal intransitive English) To go away.
Usage examples of "bug off".
His maneuver threw one bug off enough that her shot merely skimmed the sphere.
Torin scraped a congealed bit of bug off her thigh with her thumbnail.
To calm herself she lifted the Shield Bug off her shoulder, where it had been sitting quietly, and holding it carefully in the palm of her hand, she pointed out the approaching canoe and its grim trio.
She fired one last salvo, tearing the final bug off the edge and hurling it back into the frenzied roil of its companions.
Jayne rips the med-bug off his arm, pours cold water over the olive skin, through the black curls.
Kicking a bug off his boot, the boy grabbed the hands of his friends and climbed hastily back up out of reach of the cluttering muties.