Mutations can occur through several mechanisms, including random errors made by viral polymerases, recombination events, and interactions with host factors. Some viruses, like RNA viruses, have higher mutation rates due to the lack of proofreading capabilities during replication.