I have been using DVDVideoSoft YouTube to MP3 convertor. It is pretty good and does not have any malicious code.
If you use FireFox, you can also go for an extension named "Download Helper". But am not sure if it converts video to MP3.

The safest method would be to use Audacity to record the audio using the sound card and then exporting it as an MP3. I've done that for videos not on YouTube and it works good.
If you save the YouTube video to your computer and open it in VLC, you can convert the audio portion to MP3. No problem there, and I’m certain there are other, even easier ways.

From the standpoint of legalities, it’s probably safe as long as you’re not taking copyrighted material and selling it to others.

However, with the Digital Millennium Copyright Act (DMCA), there is probably no discernible rule of law anymore.

If the big media companies say they don’t like what you’re doing, then a SWAT team may come busting down your front door at 3 am and drag you away while you’re wearing nothing but your underwear.