It is only legal IF the entire purpose is satire: for example, think of Alec Baldwin as Donald Trump, or celebrities on "South Park." For non-satiric purposes, you need the celebrity's permission, since the default is that everyone (includin celebrities) controls the commercial use of their own likeness or image, subject to certain very narrow exceptions (e.g. satire; or reporting on the news).