The .22 mag cartridge is much longer and a larger diameter. I don't think it could be done.
I just tried putting a empty .17HMR case in a .22LR barrel I have here. The HMR is a necked down .22 mag. It would not even begin to go into the chamber.
The .22LR chamber can be recut to .22 mag and it will work. However, the .22LR is supposed to be .223 and the .22 mag has .224 diameter bullets. Might be hard to count on good accuracy.