When Illyana Rasputin was still a little girl, Kitty Pryde told her a fantasy fairy tale that featured the X-Men in quirky new & different forms. His appearance was based upon that of Kitty's Bamf Doll (which itself was a 'chibi' version of Nightcrawler). It later transpired that Kitty's fairy tale was real in an alternate dimension, where Nightcrawler & Lockheed met 'Bamf' and a whole race of Bamfs living in fear as their female population had been kidnapped by Shagreen.
Note: Bamf is not to be confused with the whole race of Bamfs.
Bamf was first seen as a fictional character in Kitty's fairy tale from The Uncanny X-Men #153, but the real Bamf made his first appearance at the end of Nightcrawler issue 2.