The simple answer is that, yes, if that piece was written in Bb major then it could be played in any of the other 11 major keys. The relationship between all the notes and harmonies would remain the same, but the piece would sound different. Higher or lower in pitch, for sure, but there is another aspect. Different keys 'feel' and 'sound' different. Very hard to explain - I've been a music teacher for 30+ years and a musician for a lot longer than that and I've never heard a convincing explanation. But if the key of C major - no sharps or flats - sounds 'neutral', then keys with increasing numbers of sharps tend to sound brighter, and keys with increasing number of flats tend to sound richer. C and Db are next door to each other on the keyboard but sound totally different. This difference has been known about for well over a thousand years, a little research into 'modes' will be interesting.
And there's a huge difference between major and minor keys, even those on the same note. As a very rough rule of thumb, major = happy and minor = sad, but that is a
very rough rule! If you take two of the most famous classical piano pieces of all time: Debussy's
Claire de Lune is based in Db major (with some excursions into other keys) and overall is as rich sounding as it gets. Beethoven's
Moonlight Sonata is in C# minor and is as cold as ice. C# and Db are the same notes on the keyboard.
So, to create different sounds, feelings and inspire different moods in the listener, composers, classical and non-classical, write their music in different keys.
There's a lot more to it than that, of course, and don't get me started on atonal music, tone rows or chromaticism!