Can it be dangerous to cap a drain?
There's no reason why you can't do that. Just make sure that the wye portion of the fitting has grade on it (check with a torpedo level for about 1/4 bubble)
Make sure you have enough pipe to glue to later.
The only other thing to do is make sure you're not cutting your wye inbetween the trap and the vent. That would constitute two traps on one trap arm, otherwise known as "Double trapping", which is illegal.