Obama fired thousands of people from the Bush administration. Nobody batted an eyelash. I don’t think it’s illegal (unless a republican president tries to do it).
Federal Employees brought in as political appointees can be dispatched. The latter day civil servants can’t.