When someone disconnects their account, or the account is closed by non-payment, the modem stays on the account. Its mostly so the customer may choose to reactivate or pay the balance if it was a non-pay disconnect. The modems usually drop off after 6 months of an inactive account (of any type). If the modem changes hands, the original owner needs to call Cox and have it removed from their account (they will even let you do this if their is a balance on your closed account).
All that being said, I think anyone who buys a used modem from a goodwill store, a repackaged return at a retailer, a pawn shop, swap-meet, etc is just asking for a LOT of trouble. I used to work technical support for Cox, and frequently got calls from customers wanting to swap their rental modem for one they purchased. If the modem was brand new there is never a problem provisioning it, but if the modem was previously used you run into some possible bad news. Many people on the Cox cablemodem network have rental modems. It's $5 per month, and if anything happens to it, Cox will take care of replacing it for free (it's their equipment, so their responsibility). The problem comes when someone is down on their luck, their cable has been shut off for non-pay, and they need rent money or whatever. People will take these rental modems and pawn them off wherever they can. Some pawn shops will call the local cable company and make sure a modem is not a stolen rental and refuse to take it from the person, but Craigslist, swapmeets, etc are very low key on rules, so you can get stiffed for buying a cablemodem this way. I've even seen where friends/relatives of the customer give them their "old" modem since they just switched to DSL or some other BS usually to settle a financial agreement. Goodwill and other thrift stores don't have the resources to check for stolen items, and they don't even care since the items are donations etc....
ALWAYS buy an unopened brand-new cablemodem from a reputable retailer, or buy a used modem from the cable company... they sometimes have specials to sell used modems in their inventory that have been used for over a certain amount of time, but are still otherwise good, for a fraction of the price of a brand new one... they may even offer to sell you the rental modem you currently use if used for long enough. I bought my rental modem for a penny, and no longer have a $5 per month rental fee. Call and ask. If you get a used modem shipped to you and it doesn't work out of the box (after properly provisioning it with tech support), they'll replace it for free (I've processed many transactions like that).
The cable company is a business like any other. They have rules for use of their service, and these are ALWAYS available on the documentation from install and on their websites for you to read. They are not out to "screw you" otherwise they wouldn't have ANY customers.
BUYER BEWARE! When it comes to buying any product from any risky vendor.