Of course! [I have a lot of space and haven't tried container melons myself, but I've seen lots of other growers have good success with various melons, watermelons, squash, and cucumber.]
You do need a site that gets full sun all day, a deep container, rich soil, and a sturdy trellis of some sort, since melons like to climb. Choose a small-fruited variety such as Tasty Bites http://bit.ly/10SOg5i of Minnesota Midget http://bit.ly/10SP2z6.
Some growers tie up their ripening melons with slings, purchased, or homemade from tights, pantyhose, or other fabric. [Check out some of these photos for ideas: http://bit.ly/10SQSA5.]
Melons need insect pollinators to set fruit. If you don't see bees appearing among your blossoms, or if you have tiny fruits turning yellow and dropping from the vine, you may need to hand pollinate them. Here's how http://bit.ly/10ST0I4. You don't actually need an artist's brush. You could use a Q-tip or simply push the pollen-laden male flower into the female flower to transfer pollen.
It's important not to use broad-spectrum insecticides (even those listed for organic growers), because these products kill insects indiscriminately, including the precious pollinators you hope to attract to your melon blossoms.