Does it work for my iPhone as well as my laptop?
You don’t say what Avast Program version that you have, or presumably looking at getting protection ?.
However Avast Free/Premium for windows is specifically for the Windows Operating system and wouldn’t work directly with iPhone or iMac.
For iMac see - Download Free Antivirus for Mac | Free Mac Virus Scan | Avast
For an iPhone you would need avast for iMac Mobile
See - Free Malware App Antivirus Protection for iPhone & iPad | Avast