It is not illegal to call and talk about you with a reference that you gave them - that's the whole point of a reference. Separately, yes, calling a former boss may only get the prospective employer answers like "they worked here and are eligible for rehire", but that's usually a human resources policy to avoid a costly, but ultimately winnable if you only tell the truth, lawsuit. It's not illegal for a former boss to shit on you if you were shitty, and it happens all the time at smaller firms, in small industries, or small towns.