YouTube serves the ads from the same domains as the content, which makes it difficult for a domain blocker (i.e. Pi-hole) to block the ads without blocking the content. There is a long running thread on this topic here.
There is also a user-submitted method for blocking YouTube ads - many users have reported positive results