On axes the OuterPosition and InnerPosition (which is equivalent to Position) are linked to one another. The difference between them is always automatically calculated based on the size of the axes and tick labels. If you set one, the other will change automatically. Unfortunately, this calculation only includes labels that are owned by and positioned by the axes, it ignores manually placed labels.
I think the way to achieve your goal is to leverage the Extents property on text objects. You start by creating the axes and the text object, then measure the Extents of the text, and then you can adjust the axes to make room.
What complicates this quite a bit is that position and extents are based on the container. For text objects, the container is the axes, so normalized units are relative to the size of the axes and the Extents are relative to the axes. For axes, the container is the figure, so normalized units are relative to the figure and position values are relative to the figure. The easiest solution is to work in pixel units, which are common for both.
t = text(0, 15, 'Some text here', 'HorizontalAlignment','right');
axpos = ax.InnerPosition;
leftEdgeOfText = axpos(1)+textpos(1);
shiftAmount = max(0,padding-leftEdgeOfText);
axpos(1) = axpos(1)+shiftAmount;
axpos(3) = axpos(3)-shiftAmount;
ax.InnerPosition = axpos;