I recently noticed that the badge count for Messages on my Dock was incorrect on my Macbook Air. I am currently running Yosemite and have noticed that this happens from time to time. It would not disappear however many times that I opened messages, then open and closed the application.
Here is a quick way to fix the problem for any badge count issues:
1. Make sure that you close completely out of Messages (Apple Q).
2. Conduct a spotlight search (top-right corner of your screen) and type in Terminal.
3. Once the Terminal opens up, run the following command killall Dock