The noise and complexity inherent to quantum communication networks leads to technical challenges in designing quantum network protocols using classical methods. We address this issue with a hybrid variational quantum optimization framework (VQO) that simulates quantum networks on quantum hardware and optimizes the simulation using differential programming. We maximize nonlocality in noisy quantum networks to showcase our VQO framework. Using a classical simulator we investigate the noise robustness of quantum nonlocality. Our VQO methods reproduce known results and uncover novel phenomena. We find that maximally entangled states maximize nonlocality in the presence of unital qubit channels, while nonmaximally entangled states can maximize nonlocality in the presence of nonunital qubit channels. Thus, we show VQO to be a practical design tool for quantum networks even when run on a classical simulator. Finally, using IBM quantum computers we demonstrate that our VQO framework can maximize nonlocality on noisy quantum hardware. In the long-term, our VQO techniques show promise of scaling beyond classical approaches and can be deployed on quantum network hardware to optimize network protocols against their inherent noise.