Season 1 spoilers.
We learn throughout season 1 flashbacks that Bellamy (as an Ark guard) tried to protect his sister from an impromptu ID scan, which failed, and got him demoted to a janitor position (episode 6, "His sister's keeper"). Later, his former superior, Commander Shumway, offers to put him on the dropship to Earth, provided he shoots Chancellor Jaha.
BELLAMY: What do I have to do?
SHUMWAY: Kill the Chancellor.
BELLAMY: How about I kill you instead?
SHUMWAY: Kill me and your sister goes alone to a radiation-soaked planet And you get floated like your mother. Ship launches in 20 minutes, Bellamy. If you're gonna do this, we have to leave. Right now.
Let's say five minutes to reach Jaha, five minutes to escape, five minutes for Shumway to explain why there's a new passenger boarding the ship, and five extra minutes for cover: between the timeline hinted at by the dialogue ("20 minutes"), the general confusion that must have ensued after Jaha was shot, and the secrecy around the kids being sent down, I think it's possible Bellamy kept the gun Shumway gave him.
Furthermore, the gun he used to shoot Jaha and the gun he had on Earth (here, taken by Wells in episode 2) look the same:
As per having guns in general, there weren't any other on the dropship, since Bellamy having a gun is seen as unique by everyone, including Clarke, who'd have searched the dropship for supplies/guns/gear. However, in episode 8 "Day Trip", upon raiding a military bunker, Clarke and Bellamy do find guns, rifles and the like, which they use against the Grounders.
Additional details from the books: in the first book, Bellamy holds the Cancellor at gunpoint, a shot is heard "off-screen", then the next chapter has the 100 already in the dropship. When they get to Earth and start settling, he hunts with a bow. I'd have to find an English version to include quotes, but I don't remember a mention of the gun being taken down to Earth. (which doesn't invalidate the show-based answer, though)