I'm renting a garage, and it gets too cold in the winter to work comfortably. I ordered an electric 30 Amp rated space heater but realized that I have a 50 Amp, NEMA 6-50r receptacle. Obviously I cannot just use a straight-through adapter or different plug because that would defeat the safety of the expected 30 Amp breaker circuit. However, would it be safe to create an adapter where it goes from a 6-50p pigtail, into a circuit breaker box with a 30 Amp breaker, which is wired to a NEMA 6-30r receptacle? All this would be using properly sized wire and grounding of course. Being a rented space, I don't want to be installing any permanent fixtures.
Yes. Your plan will absolutely work, and be safe. Make sure you properly use flexible cable (likely SOOW) with the breaker box you put together, and consider strain relief where the cable exits the box.
However, the cheaper route you mentioned, isn't as dangerous as you think.....
Consider any device you plug into a normal 15amp outlet. Very often, the circuit, and breaker are 20amp, even when the outlet has a 15 amp style receptacle. Say you're plugging in a cellphone charger. It needs 0.1 amp. Yet your circuit breaker exposes it to 200 times that! Omg let's freak out and build a special subpanel at the outlet to provide a breaker appropriate for the cell phone charger. Wait. Nobody does that.
Plugging a 30 amp device into a 50 amp outlet is no worse than plugging a 0.1 amp device into a 15 amp outlet. Just change the plug and be done with it.
But if you enjoy building sub panels, enjoy this project! If you build a special sub panel just for this, you should consider adding 20 amp breakers and outlets to it also. Could end up being super convenient to have.