Only in a dire emergency! There will be almost as much moisture from your body inside as there will be from the rain outside, and your insulation (whether down or synthetic) will be severely compromised.
Been there, done that, except it was a plastic tarp laid directly on top of my sleeping bag, rather than a garbage bag. Anything covering your sleeping bag needs to be breathable.
If it's below freezing, you'd be better off to use the plastic bag inside your sleeping bag as a vapor barrier. Don't wear your insulating clothing inside the plastic bag, though, or the same thing will happen to your clothing. Just wear a base layer inside the plastic.
Someone suggested to me a Dri-Ducks poncho over the sleeping bag. It's pretty breathable. I haven't tried it.