HI,
There are several fixes.
The method of using Notifications itself to make the item go away is technically less stressful on the System.
You can also open Activity Monitor (Applications/Utilities folder) and find the Dock item in the list and use the Quit icon top left (Like a grey US Stop Sign) and the press the Force Quit button.
You do the same thing by opening Terminal and using the kill command to Stop the process from running.
The first only affects Messages icon and it's number badge on the Dock.
The next two affects the whole Dock as it is reset, with the Terminal App method being the bigger of the two sticks as it were.
If the Notifications method does not work it may also point to the fact your system my have lost the ability to Write to the preferences file involved.
It might pay to run this Resolve issues caused by changing the permissions of items in your home folder - Apple Support
I prefer to use the various parts of the Mac OS and it's regular interfaces where possible.
I would want that sort of reply to any question I asked.
That's not to say that sometimes a bigger stick is needed and I would follow instructions like the last link I posted.
If you are confident with the other methods then use them.
It's about you finding a solution.
7:38 pm Thursday; June 14, 2018
iMac 2.5Ghz i5 2011 (Sierra)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
MacBookPro 15" 2016 (High Sierra 10.13.x)
Mac OS X (10.6.8),
iPhone 6 iOS 11.x and an iPad (2)