There is a big difference. When typing on a keyboard, you can make mistakes and take your time. When playing a musical instrument, you need to hit the right note on the first attempt and at the right time or it'll sound obviously wrong.
Neither playing the piano or typing on a keyboard will alone build good manual dexterity. Precision and strength are also needed.
Just writing or drawing with a pen would be a great help.