I have done that--not with a garbage can but with a perforated three foot wide five foot tall heavy plastic cylinder that I buried 4.5 feet deep. Had 6 inches of small round river rocks in the bottom, and gravel around the outside between it and the dirt. As long as it is deep enough, it will work in cold weather. It very much depends on where you live as to whether it is a good idea. In a small town rural area it works.
In a larger town or city, bagging the poo and putting it in the garbage works better. [By this I mean what I do here--I have a gallon bucket with a plastic bag lining it sitting under an upturned 5 gallon bucket with a pooper scooper beside it. Lift off 5 gallon, flip piles into bag, replace cover. Tie shut when full and add to large garbage bags just before putting them out for garbage pickup. Have never had a problem with the garbage man, so must be working.

]
On a farm, a separate compost area for dog leavings works fine--that can just be a heap layered with garden waste or old hay etc between dog deposits.
The only real problem is getting the piles picked up between snow storms in winter--spring is always a bit of a work out for those you missed with two large dogs in a small yard!
Forgot to add--I built an insulated wooden top that fit the top of the "pit" and had an "air" line of black poly vinyl pipe coming out of the lid with a little chiminey cap type of roof over it. The pit needs air to work--see why the bagging in town is better?
