Yes, both are correct.
The first doesn't convey as much information. Tied it on someone? Or tied it to something?
The 'on' in the second version implies that it is onto someone, usually oneself. That version would be the most common one to use when referring to a scarf.