SimMechanics software contains two technologies: First Generation and Second Generation. First-generation technology includes the block library and visualisation utility found in SimMechanics releases prior to R2012a. Second-generation technology introduces a simpler modelling paradigm with a new block library.
The " Prismatic Joint " block present in the First-generation block library provides you with an ability to alter the axis of rotation (Axis of Action). However, with the introduction of Second generation technology, the rotation is restricted to only along z-axis in order to ensure consistent modelling practices across all SimMechnanics parts and easy collaboration of multiple users.
As a workaround, I would encourage you to first use " Rigid Transform " block to align the intended direction of rotation with the z- axis and then use " Prismatic Joint " block to actuate the motion.