Yes, of course. At least in the United States, assistant professors generally do not have "tenure", and they will be evaluated at the end of the tenure period (typically 6 years). If they do not pass this evaluation, their position is terminated and they lose their job. That happens all the time -- most departments at R1 universities will have a case in the last 20 years where this happened.
Once you have tenure, things become more complicated. There is the concept of a "post-tenure review" at most universities, which is triggered when a tenured professor is not productive for several years (as well as for other reasons, such as misconduct). It does happen that people lose their jobs if they do not pass such reviews, though admittedly this method is rarely applied: In most cases, the person in question just gets poor job evaluations, doesn't get a pay raise, is not further promoted, and gets assigned higher teaching and/or administrative duties than everyone else.