Yes you can do it this way. But why?
For not much more cost than buying the WiFi dongle, you can get an inexpensive router that will maintain the wired connection to the PC and give abetter WiFi signal for wireless clients. And unlike your PC it will require only a small amount of power to be always on and be much easier to set up and administer. The router will also offer a layer of firewall security that a direct connection lacks. Older model routers can be purchased for as little as $15-$20 if you check the bargain bins at your local computer store.
BTW, are you sure your connection is just from a cable modem or does the equipment also have a router function? It is pretty rare these days for cable companies not to provide a router, even if it is not WiFi. If you are renting already and want to continue, ask the cable company to replace the modem with a wifi router. Make sure the new equipment is for the same rental fee.