You could, but if you have indexed shifters, you'd have to replace those as well. You will also need a 10 speed chain which is narrower. You may also need to replace the chainrings.
You're probably better off sticking with the 8 speed stuff.
You're probably better off sticking with the 8 speed stuff.