If supervised then yes
I think as long as the swing is by the bed and the baby is strapped in then for those nights where the baby just won't settle then there's nothing wrong with them sleeping in there. Especially if they're the type designed for the baby to nap in. If they weren't safe to sleep in then they would have warnings about letting your baby sleep in there.
I'm talking about the newer modern swings though. Not the old crank style or any where the baby is in a sitting position because if your baby's head is forward as he's sleeping it's possible that the angle can cut off the air supply so keep that in mind.