In the classical period of Western music the only generally legitimate ways a composer would appropriate another composer’s music would be to “transcribe” it for different instrumentation, or to write variations on that composer’s theme.
This was quite a common practice, and some great works of the Western tradition originated in this way. For instance, Sergei Rachmaninov’s Rhapsody on a Theme of Paganini (1934) is one of many sets of variations on the 24th “Caprice for Solo Violin,” the last in a set of works written by Niccolò Paganini between 1802 and 1817. (Paganini’s Caprice is itself a kind of brief set of variations on the theme.)
This classical practice influenced the development of jazz, and has parallels with the practice in jazz of improvising on standard themes.
See also: transcription