Is a virtual machine efficient for isolating viruses from pop-up ads?


To be more clear, I would like to access movie streaming websites which have lots of (pop-up) ads and I’m fearful that I might deal with viruses.

Would VirtualBox help me isolate this type of viruses? What can I do to prevent this?