by Luis de Vasconcelos.
I doubt it's a setting in Moodle. Most likely it's some adware/spyware browser extension that has hijacked your browser and is inserting it's advertising junk into the pages in Moodle.
I would highly recommend a thorough adware/spyware and virus scan.
Do you see the ads on ALL the computers that access that Moodle site? If so, then the adware/spyware may be installed on the server. If you onlysee the ads on some computers, then the adware/spyware is probably only installed on those affected computers.