I don't know that it functionally matters. You want to get the door painted pretty quickly so its protected from the elements. In installing the door you may have to remove/replace trim, which would then need to be painted, but it's not really a big deal to touch up the siding as needed. If you do all of it at the same time, I would paint the siding first, then the trim and door. But that's assuming it's all happening within a week or so.