No, ransomware and viruses are forms of malware but they are not the same thing. Ransomware aims to block you from accessing data or encrypting it whereas viruses will replicate and rewrite the codes of your programs.