I've done it before.

I've seen neighbors put it in ours before. The way I see it, better in the trashcan then on my lawn. I don't do it often of course but I've done it when I took him for a long walk or there was a hole in the bag.