Can we view or edit HostName value via macOS desktop UI?
There's no place in the GUI to change it, because it's typically set by an external source.
Your hostname is determined by the following (in order):

name supplied by DHCP/BOOTP server
name returned by a reverse DNS lookup
the localhost name (what was used to set LocalHostName value)
name acutal name localhost

Most routers now have the ability to &quot;register&quot; the DHCP lease in the DNS resolver cache.  So, what's happening is this...
At some point, your Mac didn't exist as a DHCP mapping or DNS entry on your router.  When it connected, it sent a request which included it's preferred hostname along with a request for an address.  That preferred hostname defaulted to your LocalHostName as the first two conditions would have returned nothing.  When you got the address, it &quot;registered&quot; that hostname with an IP.
Now, you want to change the name, but it keeps coming back to the original host - this is because the router now &quot;knows&quot; your machine has having that name and will overwrite it per DNS (which takes priority).
TL;DR
That name is coming from your DHCP Server and/or DNS chache.  If you want to clear that out and set a new one, you'll have to do it at the router.