You can use any lens for portrats: from super wide to super long.
But when you are making a headshot, as opposed to an environmental porytrat, the face is large. And in that case you do not want to use a wide lens, like a 24mm lens, or this will happen:
The face is distorted; the nose is too large.
Instead, using a long lens, like a 70-200mm lens – or at least 50mm or more on a crop camera – is more flattering:
The wide-angle lens is good for environmental shots:
Rule of thumb: if the person/face is large in your pic, go long; if the person/face is small, you can go wide.