The short answer is that it varies. In some cases an institution might be quite willing to consider a strong applicant who is outside of the preferred area of specialization, while in other cases it may be very important to the institution and they'll only take someone outside of the preferred area if there are no reasonable applicants in the preferred area.
The one thing that you can be sure of is that there will almost certainly be a substantial number of applicants who are in the preferred area. You won't get the job unless (1) the department is willing to hire outside of the preferred area and (2) you're a stronger candidate than all of the other candidates who are in the preferred area. That's a pretty high bar.
My own experience on hiring committees for positions in applied mathematics is that a large fraction (maybe half) of the applications come from candidates who aren't in the desired area. As a search committee member, I look at their applications and drop them from consideration with no more than a minute or two of consideration because we've always had plenty of good candidates in our area of interest.