New android tablet ad popups when using tablet, not in browser

A

AC Question

I recently bought this android tablet, and I am really enjoying it. However , I am now considering giving it away as these random ads, and random app installations are driving me crazy.

I'll be watching Netflix and suddenly the movie wil stop due to a add popup or a box that says installation blocked

How can I get rid of this'?
I read somewhere that this could be malware coded into the os
Can I format the device and reinstall android on it?

Kurt