You would use macro quoting to accomplish this.
A simple version of your example:
%macro outer_macro(macro);
%put Starting outer macro;
%unquote(¯o) /* %unquote removes the NRSTR escape characters */
%put Ending outer macro;
%mend outer_macro;
%macro inner_macro;
%put Starting inner macro;
proc print data=sashelp.class;
run;
%put Ending inner macro;
%mend inner_macro;
%outer_macro(%nrstr(%inner_macro)) /* %nrstr is execution-time quoting, so %inner_macro is passed and not treated as a macro until %unquote removes the quoting */
To involve something like a loop, you'd just make sure everything was set up to take the loop iterator - one way is simply to append ( ) with the loop.
%macro outer_macro(macro);
%put Starting outer macro;
%do i = 1 %to 19;
%unquote(¯o)(n=&i.) /* resolves to %inner_macro(n=&i.) */
%end;
%put Ending outer macro;
%mend outer_macro;
%macro inner_macro(n=);
%put Starting inner macro;
proc print data=sashelp.class(obs=&n. firstobs=&n.);
run;
%put Ending inner macro;
%mend inner_macro;
%outer_macro(%nrstr(%inner_macro))