A QB passing the ball is a defenseless player, but he can still be tackled as long as the hit is not late or to the head or neck area.
Think of it the same way as you would a receiver catching the ball. You can still hit him, as long as it isn't a hit that would draw a personal foul or pass interference.