Showers are supposed to have 2" all the way to and including it's connection to the plumbing stack. 1 1/2" is ok for tubs because they can hold water accumulation.
This is code probably not in keeping up with the times as shower heads now are designed to limit water flow to far below what a 1 1/2" drain can handle unless it's a shower with multiple body sprays.
You would need to change out the entire drain line, but if you used a reducing fitting only your conscience would know. Can you sleep at night if you do that?

If it's getting inspected, you could get called out on it.