You would be modifying a pistol to accept a mag that was not designed for it & it would be over 10 rnds and you would be breaking the law .
If you modify a 1022 rifle for a mag that was not designed for it you are breaking no law as there is no round limit on rimfire rifles.