Hello,
You can rename a container after creating it.
But renaming a service in a swarm cluster might not be possible. In fact service renaming could affect service discovery and DNS.
A swarm service is scheduled as a task, which creates/controlls the container.
What you pasted is the task name, it consists of {servicename}.{task_slot}.{task_id}. It can not be changed.