Serious musicians often experience their instruments as an extension of their body. In any case, their instruments are usually deeply personal things.
High-level instruments also tend to be very expensive and difficult to replace.
Therefore, you should never play a musician’s instrument without asking first.
It’s a good idea to err on the side of not asking, unless you have a very good reason to suspect that they might be ok with sharing their instrument. (Eg: you’re very close friends and you’re both musicians, or you know they’ve been ok with other people playing them sometimes). And it’s good to ask in a way that makes it clear that it’s a request, not a demand.
Pianos and keyboards are a partial exception – since it’s relatively difficult to break them, and they’re usually played by more than one person, most people who have pianos are willing to let other people play them. But it’s still good form to ask.