We may learn (how) to play a musical instrument. When we learn to play an instrument, we acquire the skills to play a type of instrument.
He learned (how) to play the piano.
We may learn to play an instrument using a particular instrument of its type. We use the preposition on to refer to the particular instrument being played; it is the vehicle or platform on which the learning takes place:
He learned to play the piano on an old upright acquired from
a speakeasy that was very popular during the Prohibition Era.
This is the piano he learned to play on.
P.S. Consider these sentences without on:
This is the piano he played.
This is the piano he learned to play.odd
The first sentence refers to a specific piano. It is easy to think of a real-world scenario where one might refer to the specific instrument:
This is the very piano he played in his Carnegie Hall debut. Bids will start at $250,000.
But if we refer to the specific instrument with learn, the listener may infer that there is something atypical about that piano which itself had to be learned, that the piano was in some way not representative of its type. That is not usually the case, but it is not impossible. Therefore, we cannot say that on is compulsory. But in most cases, the instrument is going to be representative of its type, and there will be nothing atypical about it, and if we don't want the listener to think there was something atypical, we would say:
This is the piano he learned on.