Neither of the other answers are technically correct, so I will add mine.
eBook readers are computers and they run computer operating systems, so they are inherently vulnerable to exploitation, including viruses and trojans. (The same is true of routers, cable modems, DVRs, home security systems, automotive entertainment centers, smart refrigerators, etc.) Additionally, there are a lot of ways that malware could get onto your eReader that you have just plain never thought of.
While it seems to be rare, some people have reported getting viruses on their eReaders, such as this individual whose kindle was apparently infected with a virus that targets flash drives.
eReaders probably have low "hack value" to malware creators. Malware generally serves one of two purposes: obtaining money (for example ransomware or bank hacks) or obtaining power (for example botnets used for DDoS attacks). When it comes to these two things, eReaders are probably pretty low on the list of targets for a variety of reasons. But you can never be sure. A year ago, no one would have guessed that the most effective botnet to date would run on infected DVRs and cable modems. But then Mirai happened.
There are quite a few ways your eReader could be infected with a virus:
- Multimedia files (like images, movies, and sound) are all binary file formats, which means they need to be interpreted by software on the device before they can be displayed. All multimedia file interpreters could potentially have vulnerabilities. Android in particular has been found over the past few years to have many (for example Stagefright). These vulnerabilities have been patched in newer versions of Android, but chances are that your 4-or-more-year-old Android-based eReader hasn't received any security updates since you bought it.
- MOBI/AZW/KF8 are binary formats that rely on interpreters to read them. If someone were to reverse engineer those interpreters and find a vulnerability, they could craft a malicious eBook to compromise vulnerable devices. The same is true for EPUB (which uses zip compression, a binary file format).
- PDF is an executable binary format. If you have ever gotten spam email with a PDF attached, it was almost certainly a maliciously crafted file that exploits a known vulnerability in some version of Adobe Reader. In the same way a PDF attachment in your email can infect your computer, a PDF file could be specially crafted to exploit a vulnerability in an eReader or its OS, and opening the file would infect your device.
- If your eReader is network connected (over wifi, 3g, etc.) it can been seen by other devices on the same network, and could be accessed if any ports on the device are open by default (which is a possibility) or if there is a vulnerability in any of the device's network protocol handlers. Therefore, a malicious agent inside your network (such as some other infected device) could potentially compromise your eReader.
- Your eReader could potentially be exposed to the wider internet if it was poorly designed (for example, if the operating system is opening ports on the router via universal plug-and-play... but hopefully you've turned off UPnP in your router's admin panel anyway). If this is the case, it could become infected with a Mirai-like worm if someone were to decide to target that type of device.
- Your eReader almost certainly has a USB port that you use for charging and transferring files. Operating systems inherently trust USB devices that are plugged into them, and this can lead to all sorts of problems if a malicious USB device is plugged in (see PoisonTap or Rubber Ducky for examples). (Edit: Apparently some peoples' eReaders are being infected over USB like this.)
- If all that isn't bad enough, it's possible that some eReaders already have malware on them that was installed in the factory in China (like happened with over 700 million Android smartphones). Or the manufacturer could have deliberately included a backdoor (like happened with over 80 models of Sony webcams).
- If your eReader has a web browser, it is a potential vector for infection.
I'm sure there are other ways that I'm just not thinking of right now.
It's probably better not to think about it too hard. You could end up paranoid.