Can you get a virus on an iPhone?

Instead of paying for a subscription to Netflix or something else that streams tv shows and movies, I go to websites like putlocker and 123movies and I get pop ups that tell me my phone has a virus. I know almost nothing about technology but to my knowledge it's almost impossible to get a virus and you can only get one if you jailbreak your phone but my phone has been weird so I can't tell if it's a virus or if it's an issue that has to deal with the software or touchscreen

No