Can I safely plug a two prong plug into an extension cord with a ground socket?
Yes you can safely plug the appliance into a 3-wire cord and plug set, as long as that is the factory installed cord and plug on the router.

Appliances that are  double insulated do not require an equipment grounding conductor to earth because the live electrical parts are specially separated/insulated from the case in a way that prevents any single failure from electrically charging parts that the user can touch.

There should be the words "double insulated" on the chassis, and/or this symbol: