It could be that an app you have installed has ads, which many people install but don't realize how much of a pain they can be. As some don't just show ads within said app.
It could also be that one of the apps on your phone is allowing for other apps to be installed, which then those apps are the ones showing ads.
You are going to need to go into your "Settings" and then "Apps" and go through the list. Is there any app listed you don't recognize? If so, before deleting it, look it up online. If it isn't a system one or a required one (and not one you chose to install) uninstall it. It should allow for uninstalling as usually only ones installed by the manufacturer or carrier/service provider don't allow for uninstalling.
Once you have removed whatever app(s) may have been added that you didn't want, restart (power off and back on) the phone. Should you get ads still, then go back into "Settings" and then "Apps" and locate the apps you installed. Tap each one individually and scroll down. It should show you what permissions were given to it. You can then decide if you want to keep the app or not.
Should none of this resolve it, and you have checked the phone for malware and also for viruses and then found nothing, you may have to then do a "Hard Reset" to resolve this. Just save that for last, as it totally wipes the device.