Update: Fixed it!! The solution is in the comments below if anyone else has this problem.
I renamed a name tag in an anvil (that worked perfectly); however, when I went to the dog l intended to name, it just didn't let me. I've renamed the name tag a thousand times, tried to name every single mob possible (tamed and non-tamed), tried the same pattern on other worlds (modded and non-modded), and it still does not work. This name tag problem has been going on for a while. I decided to report it now because I reached the point where l'm genuinely losing my mind about this issue.
Did you tried :
Settings > Video > In-game Player Names (On) ?