If an answer isn't applicable to Ubuntu, then it's simply not an answer and should be flagged as such.
However...
If an answer is applicable to other distributions (doesn't matter whether they're Debian-based and/or similar to Ubuntu) as well as Ubuntu, it should be OK to post/keep relevant info.
Also if an answer contains addendum as parts of an answer, that are applicable to other distributions, that should be OK, too.
For example, "To fix XYZ on Ubuntu, do ABC; For the same problem on RHEL, you'd instead do PQR". After all, it contains the necessary answer for Ubuntu, and we're not against other distros or sharing knowledge/information as long as there's a valid answer for Ubuntu.
With respect to this answer:
It's not clear whether it'd work on Ubuntu as well. So if somebody confirms that it works on Ubuntu as well, great, it's a valid answer.
Similarly, if somebody confirms it does not work on Ubuntu, then it should be flagged as a non-answer and probably deleted.
But as it is, it's an ambiguous situation. It may turn out to be relevant answer or may not. Under the circumstances, you did the right thing by pointing this out.
I also find the response "[..] which is the page you linked to, is about what topics people can ask about here, and it does not say anything about answers." ridiculous. To take it to an extreme, can I post "yesIn general, take the train to Scotland" as an answer? Because it may be a valid answer for some question?
An answer posted to any question is intrinsically tied to the question; doesn't exist own its own. Generic answer, additional information, historical artefacts or background, etc are fine. But it should be an answer to the question to start with.
The point of having a dedicated https://askubuntu.com site is to find solutions for problems pertaining to Ubuntu ecosystem. As noted previously, it's fine to post answers that may also applicable to other distros as long as it contains answer(s) valid for Ubuntu. Without that, it's just a useless noise. Otherwise, why not merge https://askubuntu.com with https://unix.stackexchange.com?
It may be relevant to refer to the history, too.