If the answer works on Debian but does not work on Ubuntu, then it is not an answer for Ubuntu and the scope of this site. If the solution works on Debian and Ubuntu then it's a valid answer. Otherwise it's not a valid answer and should not be posted.
This said, if the solution works on multiple distributions including Ubuntu then that is a valid answer ...
help/on-topic provides a clear definition which distros are on- and which are off-topic:
Questions that you may ask:
Using and administering official Ubuntu flavors: Ubuntu, Ubuntu Budgie, Ubuntu MATE, Kubuntu, Ubuntu Kylin, Lubuntu, Ubuntu Studio and Xubuntu.
Questions that you should avoid:
Linux Mint, Elementary OS, Backtrack, ...