YES, YouTube can ban you and take legal action if you illegally download videos. BUT it is pretty challenging for them to spot such actions.