This is actually technically possible but annoyingly difficult. First, a figure has a WindowButtonDownFcn and WindowButtonUpFcn that will tell you when the user has clicked their mouse on the figure. The WindowButtonDownFcn callback would be invoked when the user clicks down to begin dragging the slider. There is also a WindowMotionFcn callback you could use to get the current x,y position of the mouse after the WindowButtonDownFcn has been called but before the WindowButtonUpFcn has been called.
From there, unless your slider is directly on the figure where you are getting your x,y coordinates from in the WindowMotionFcn you would need to do a coordinate transformation to go from figure units to panel units where your slider is positioned.
So definitely technically feasible with pure Matlab. Just difficult in implementation.