A potential employer may ask a former employer whether an ex-employee was fired. The potential employer can also ask the former employer to verify whether the ex-employee was laid off.
Prospective employers can ask anything, but under law, they cannot make hiring decisions based on criteria such as age, sex and other protected categories.
To avoid liability issues, many companies have policies on what they say about former employees. Companies might only comment on a former employee's employment dates, position and salary. However, such policies are far from universal, and job applicants risk being tripped up if they say they were laid off when they were, in fact, fired.