Sure they could, but it's unlikely.
Speaking generally - it's statistically almost impossible your iOS device was compromised on the OS level. The most likely price for a vulnerability on iOS 10 or iOS 11 would be 5 to 15 million dollars. That means run of the mill viruses can't afford them and would profit far more selling to governments and spy agencies which generally design and deploy them to never spread so they don't get discovered.
Unless you work for atomic power / weapons research or intelligence or some very powerful company / people, the odds you have a virus on iOS is low.
That being said, if you have sketchy apps, downloaded files or jailbroken devices it's quite possible your files could be compromised with run of the mill PC viruses and much less likely Mac malware and least likely Mac virus.
The steps you take to protect your computer could be as simple as enabling GateKeeper, only running signed apps, updating your Mac. If you want windows protection advice - you might ask that on https://superuser.com or from Microsoft.