At what point is unsolicited explicit material considered harassment? How do the advertisers have the right to broadcast something that I would definitely bring up to HR if I heard a coworker say?
The contexts are too different. One cannot expect much similarity on how the unsolicited explicit communications are addressed.
On platforms such as Youtube the unsolicited explicit material is not sent specifically to you, but to a set of users who at best have some characteristics in common. By contrast, akin communications in a work environment are much likelier to constitute harassment insofar as they usually are intended for a specific person. Your own use of the term "broadcast" reflects your acknowledgment of that difference.
Another difference relates to the recipient's dependency on the environment where the unpleasant communications occur. Implicit in the anti-harassment protections in a work environment is the acknowledgment that the recipient's livelihood depends on that person's continued employment. That dependency renders such communications a form of coercion. By contrast, dependency is much lower or non-existent when it comes to entertainment platforms: the recipient can leave the platform without any consequences that might threaten that person's livelihood.
Have I entered into an agreement with the service provider than I consent to receiving these advertisements by using their services?
That is hard to tell. You will need to read the terms of service of these platforms and post another question if some clause(s) is(are) unclear.