It's definitely OK to do that in general; many users refer to other answers to the same question in our answers, for example when talking about when different methods are preferable.
In the case you mention, the comments on the other answers are to some extent critique. I would probably agree that those particular remarks could have been posted as comments on the other answers, but also (or only) posting them in the answer is fine too, because comments are not durable - they can easily be deleted and only mods can see deleted comments. If a question has many answers, visitors may only read the first one or two or few they see. They may never read the answer that says you should [...] and the critical comment on it, but they might have the same idea independently. It's probably better for a more visible answer to say something like "As
(this answer by whoever)[link] suggests, you might consider doing [...], but if your situation is [...], that's not the best idea because [...]". Unless (perhaps) you're harshly condemning the other answer, pointing out that the idea comes from another answer is surely good etiquette, because you're acknowledging the author for their idea, as well as making the reference clear.
Here's a good example of an answer that critiques other answers on the same question. The author of this post didn't comment on the answers being critiqued to point out the issues discussed.
In general, rather than writing something vague like "one answer says [...]", there should be a link to the answer being talked about so that it's clear what the author is referring to. That way, as well as removing the immediate ambiguity, if the answer they are mentioning is edited in the future, readers can resolve any confusion and if necessary point out the need for a correction.
Of course, references to other answers should follow the be nice rule. If you're criticising someone's work, don't make it personal.