If I had a quarter for every time I’ve heard somebody say “this beer tastes better in a bottle” or “I love that beer except in a can, then it tastes like crap,” I’d have like $1.25. Still, I think this sentiment is worth addressing and a little knowledge is worth dropping. First, a ground rule; If you are comparing draft in a glass to drinking straight from a can, they WILL taste different. If you are going to make judgement on a beer, drink it from a glass.
Since, it’s the odd duck, I’ll cover kegs separately. Draft beer is the most variable because many aspects of beer flavor can be affected by the establishment that is serving the keg. Dirty lines can make beer taste off, so can leftover cleaning solutions, or how glassware is cleaned. Refrigerator temperatures and serving gas pressure/type can also change how a beer tastes, especially over time. This is why, when talking about places that have 132 taps, my brewing professor would advise always getting something from a bottle. Some of the belief that draft tastes best is a holdover from breweries that pasteurize beer. Without going into the specifics of pasteurization curves and methods, pasteurization affects flavor. Depending on methods that effect can be noticeable. Due to the size and quantity of liquid, kegs can’t be pasteurized in a tunnel pasteurizer. So you would have packaged beer tasting different from draught beer. However, this does not hold very true with craft brewers because most don’t pasteurize at all. So in conclusion, does draft taste different than a can or bottle? Possibly and probably even likely.
Cans vs. Bottles (or why cans are indeed better)
This comparison is strictly cans and bottles as storage devices because the liquid came from the same process and quite often from the same tank on the same day. As noted above, drinking straight from these storage devices will cause a sensory divergence. They have different opening sizes, your mouth will be touching glass or metal, etc.
Cans keep beer flavor stable, longer. The attachment of the lid to the body is a hermetic seal (this means nothing in, nothing out). By comparison crown closures on bottles leak (carbonation out and air in), albeit at a slow rate but we still have to have oxygen scavengers on the crown. Remember: oxygen+beer=bad. Cans let zero light contact the beer. Bottles, however, let a range of light in. We mitigate the effect using brown glass, which is the least damaging, but direct or long term light will still cause a problem. So I don’t have to type anymore than I have too, just look up how beer gets skunky to understand why light is a problem. Aluminum is also better environmentally. Aluminum is lighter than glass. This saves a considerable quantity of transportation fuel. Recycling aluminum is more efficient than glass as well and shown to be more likely to happen. The only reason I can come up with on why bottles are better is they are a reusable package, they stack higher, and can possibly be used as a weapon. (Getting hit with an empty aluminum can would just be annoying.)
Why else would a beer taste different?
For the same reason as me pointing to Google for you to learn what causes skunked beer, I won’t go into all the reasons a beer might actually be different. I’ll stick to perception. Let us consider the human element. Sensory science is a fuzzy thing. Humans are too complex to make good conclusions based on our senses. We taste things differently if we are happy or sad, sick or just pumped gas. We taste differently if we are hungry or recently ate. We taste differently based on how something looks. Are you surrounded by friends at a baseball game or sitting by yourself on the couch? Get the idea? I went through a week long period where I couldn’t taste hops (randomly, I wasn’t sick or anything). If you enjoy a beer out of the bottle but tried a can and hated it, (barring potential age or poor storage conditions) you’d be better off looking at your conditions (glassware, mood, etc) than the package type.