Is it ok to change a resonator mid pipe with a glass pipe

A resonator is a glass pack tuned to the vehicles exhaust to cancel out noise before the muffler.

If I were to do this, I’d make sure the diameter/length of the resonator was as close to the original as possible.

Tester