Currently, the only way to leverage a network service or routing service is to use Esri network service or have ArcGIS Enterprise to host it. Esri's AGO network service (that solves network analysis questions) is not editable. This leaves a user with having to host the network dataset locally on ArcGIS Enterprise and then sharing it with AGO.
Esri's ArcGIS Online does not have the capability for a user to design a network dataset in Pro and publish it to ArcGIS Online as an item with special capabilities as a trace network or routing service.
Users building their own routing service (ex. Indoors routing network) must have ArcGIS Enterprise available.