Apple Music itself does not have any ads. Third party or local radio stations may have ads though...which makes sense since those are free and don't require an Apple Music subscription to listen to those. Plus, Apple can't control what they're streaming.
You can go to your 'Recently Played' list under 'Radio' in the Music app to see what station was playing. Sounds like you may have already done that and saw it was TuneIn. If it was a station hosted by Apple Music, then there shouldn't have been any ads.