I feel there are two different layers to that - whether, and to what extent, teaching evaluations are actually anonymous, and if they aren't, whether it's still "safe" to give a bad one.
Are evaluations anonymous?
On a superficial level, all universities that I have taught at had entirely anonymous evaluations. At no point in the process was I ever told which student gave which feedback. However, in a small class (say 10 students or less), anonymous evaluations aren't really all that anonymous - in such classes, I often have at least an educated guess which student wrote which evaluation. In a larger class I usually have no idea which student wrote which comment - there are usually groups of students with similar concerns and troubles, and I also don't know individual students nearly well enough at the end of a 100-students class to divine which student may have written what.
Yet, even in large classes sometimes a teacher may have a hunch which student wrote a specific comment, if the raised concern or the way of expression is sufficiently unique. For instance, in one of my introductory classes last year, one student was struggling extraordinarily and it was clear that he was working all the time on this course to pass (which he ultimately did). When evaluations came in and one student remarked on the almost unsurmountable workload it's easy to at least suspect that this was this student.
In short, relying on anonymity alone may be a dangerous game. If I were giving some really negative feedback I would try to keep it general enough that at least a handful of students could have written the same comment.
Is it safe to give a negative evaluation (assuming it's not, or at least not completely, anonymous)?
Clearly, teachers are supposed not to retaliate upon receiving a bad evaluation, and I expect the large majority of teachers in a reputable university will not. However, professors also being humans, a subconscious bias may still taint further interactions. I guess it depends on what you mean with "safe" - there is no 100% certainty that a negative evaluation will not backfire on you, but by and large I can tell you that many students give negative evaluations in all schools I have been at, and as far as I can tell nothing bad really happens to them.
It's not really your question, but in my experience it is almost universally a good idea to try hard to phrase negative evaluations in the same way as you would also do when giving feedback face-to-face (that is to say: fair, polite, without unnecessary superlatives, and if possible strengthened by data). Ultimately you probably want your feedback to be heard / integrated into the next course iteration, and the less a teacher is annoyed by your comments, the larger the chance that they will actually consider them. If you want to use evaluations to vent, this is certainly your right - but you should be aware that your evaluation will then have virtually no impact on the course design.