Answer: You can compost in a garbage can, or most any other container. If the unit is sealed the process is anaerobic (without air) and can produce some odor. But the contents will heat up quickly and stay warmer longer resulting in faster decomposition. You can minimize odor by turning the contents of the can frequently to incorporate air. Either metal or plastic will work, with or without lids. Be sure to put lots of drainage holes near the bottom for the liquid to seep out or you'll have a can of soupy stuff instead of nicely textured decomposed organic matter.
Here's a website filled with information about the basics of backyard composting:
Q&A Library Searching Tips