You have proven why anti-virus is not recommended. Their sole purpose is to collect money from you and scare you into thinking that you need to continue the service.
As for the malware, it is not possible to remotely install malware on your iPhone. It is possible that you were a target of a phishing attempt to get your Apple ID and password. Nothing will stop you from giving this valuable information away and when you do, the security of your Apple account is compromised and has nothing to do with your device.
Please review these two articles on how to avoid phishing attempts and what to do if your account has been compromised.
Recognize and avoid phishing messages, phony support calls, and other scams - Apple Support
If you think your Apple ID has been compromised - Apple Support