It depends on the license of the music. YouTube is good enough to detect improper use of music in videos and if there is a problem, you get a notification to change or remove the music.