Shooting an ender dragon directly in the head (or from certain other angles) with a firework rocket from a crossbow does not damage it, but shooting its body usually will.
See MC-313167 for repro steps and video. If that report is indeed a valid bug, the scope of this report is limited to while the dragon is flying.
Can confirm.