In theory, it shouldn't matter what order you reboot.
But, in practice, I find that if you reboot your publisher or subscriber while your distributor is still running, then you will get a flood of connection errors in the replication logs.
I'm assuming you use transactional replication.
So, I always disable my sql agent on the distributor, then I reboot the publisher and subscriber and then finally I reboot the distributor, which auto-restarts the sql agent service, which restarts the various jobs used for replication.