You certainly can do this.
I'd advise reading the manual [Logic Studio Instruments (en).pdf] from p294, as there is a detailed explanation there.
Open the EXS24 editor (click the edit button top left)
In this window, top left, you'll see Zones and Groups - click Groups.
Go to the View menu and enable [Group: Select Group by...]
A new set of columns opens in the edit window, where you can choose the type of event you want to trigger each group of samples (eg Note) and then the note # etc etc.
You'll need to know how Groups work, so check out the manual for all this.