You can run a checksum verification on an .iso image. However, you should not be burning the image to disk from an infected system. Create your bootable medium on a different machine or order a disk online. An additional concern is that a virus can also be written into a boot record, firmware compromised, etc. So once a machine is compromised, you can't really trust it to be able to clean itself.
It seemed worth adding that since you are interested in checking file integrity in an environment with LIKELY malicious tampering that the MD5 algorithm is no longer considered secure:
The underlying MD5 algorithm is no longer deemed secure, thus while
md5sum is well-suited for identifying known files in situations that
are not security related, it should not be relied on if there is a
chance that files have been purposefully and maliciously tampered. In
the latter case, the use of a newer hashing tool such as sha256sum is
highly recommended. md5sum wiki article