I have a plug for a wireless router that ends in two prongs (no ground). Is it safe for me to plug this into an extension cord that has the ground prong, which would be left empty? I believe it is but want to double check.
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:
If the power cord on the router is one of the modern type like this ...
... with one blade wider than the other then you have a polarized plug with the neutral routed through that wider prong. You want to make sure to properly orient the plug at the extension cord so that the wider blade goes into the wider slot.
Note that there are lower quality extension cords where it is possible to force in the plug wrong way around because the molded plastic will just stretch. This is one reason that you now see cords that have hard plastic around the holes that is then overmolded with the more flexible material.
In general, yes; in terms of grounding this is no different from plugging such a cord directly into an outlet.
Where you need to be careful is that your extension cord is rated for the power that your device is going to draw, but this has nothing to do with two-prong vs. three-prong plugs. (Also, grounded extension cords are typically rated for more current than devices with two-prong plugs typically draw, and even then, I think almost all cords are rated for at least 1A, which means you will likely only need to worry about devices that draw more than 1A / 100W. Edit: looks like you're unlikely to find less than 10A, so up to ~1000W should be safe, but if you're paranoid, stick to 500W unless you know the rating.)