Moiz Shujauddin: Thanks for posting about your (unfortunate) experience with the loss of your device.
This case is fairly common for lost or stolen devices, unfortunately. Phishing us. We ourselves are easier to hack than our devices. Text messages, and telephone calls, and variously callers even claiming to be the police have all been reported as tactics to try to get our Apple ID credentials, for instance. These groups automate the credentials-collecting websites, too.
SravanKra: As for the title of this thread, iPhone and iPad can be hacked, even on current versions. It’s rare, but it happens. Apple usually the releases a patch, as the exploits become known and vulnerabilities are remediated. But there are always new vulnerabilities discovered and variously exploited, or we wouldn’t be getting on-going patches from Apple. But in this case as with the majority of “hacked” or “virus” cases we see posted around here, we ourselves got hacked. Not our devices.
Moiz Shujauddin: If you think your Apple ID has been compromised - Apple Support — yours obviously has been compromised, which means all your other passwords are quite possibly exposed too, if you’re using iCloud Keychain.
Some related info on scams:
Scam Pop-ups, Scam Viruses, Scam Receipts… - Apple Community
Recognize and avoid phishing messages, phony support calls, and other scams - Apple Support