You can keep a backup copy of anywhere-purchased ebooks on your computer.
Most devices (Nook excepted, with caveats, of course) allow sideloading, just by connecting as a USB device (and preferably using calibre

). However, it will become necessary to trick the server into syncing the annotations/place data -- you can manually change the ASIN on a Kindle Book, so Amazon thinks it is their (sync-supported) book, or email to your send-to-kindle email address as a Personal Document. I don't know what the options are for Kobo.