The third edition (1737) of Nathan Bailey’s Universal Etymological English Dictionary, first published in 1721, contains “A Collection of the Canting Words . . . used by Beggars, Gypsies, Cheats, House-Breakers, Shop-Lifters, Foot-Pads, Highway-men, etc.,” and carries this entry: “A BAM, a Sham or Cheat; a knavish Contrivance to amuse or deceive.”
Bamboozle, a verb of like sense, is not shown but is the same age, late seventeenth century, and is among the terms listed by Jonathan Swift in 1710 as among the slang terms of “Continual Corruption of our English Tongue.”
Others were banter, put, sham, mob, bubble, bully.
The word is not related to bamboo. In fact, clues to its origin are lacking.