"leave quickly," 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. Also see bug (v.3). To bug out "leave quickly, scram" is from 1953.
"to scram, skedaddle," 1953, of uncertain origin, perhaps related to bug (v.2), and compare bug off. Bug out (n.) "precipitous retreat" (1951) is from the Korean War.