Many ebooks have DRM (digital rights management, or what was once called copy protection) and can only be read with certain apps or devices. So, if you buy a Kindle ebook, they want you to use the Kindle app or a Kindle, Barnes & Noble want you to use the Nook app or a Nook, etc. As you've noticed, this is pretty suboptimal if you don't want to be restricted in your choice of online bookstores or have to remember the ins and outs of a gazillion apps. Or if you would like to still be able to read your book down the road even if the vendor stops supporting their app or whatever.
There are legal sources of non-DRM'd books out there, but many have older or self-published material. Project Gutenberg, Feedbooks, and Smashwords are good sources of free or low-cost books without DRM. If you like SF, Baen Books does not use DRM and sells books at very reasonable prices (some are free through the Baen Free Library). There are also other smaller specialty or genre publishers that don't use DRM - the Mobileread forum tends to be a good place to find out about things like that.
If you want to purchase DRM'd material and read it with an app that does not accomodate that type of DRM, the DRM must be removed. The legal status of this seems uncertain in the USA so I won't go into details. Google is your friend, and so is Apprentice Alf.
Hope this helps.
P.S. The above assumes that your reading app will handle the common .epub format in which most books are sold these days. Note that format or file type is an entirely different thing from DRM, which is an encryption scheme applied to the file, keyed to your device or sometimes to your credit card number. If you need to convert file types, the free ebook management program Calibre will handle most conversions on non-DRM or de-DRM'd material.