It is doable since WW2 if not earlier, and occasionally done, but it's always a kinda desperate move from lack of guns or lack of better use for old tanks, rather than because it works well, because it doesn't work well. It is always found out to be suboptimal, as you can optimize a vehicle to be a good tank and crappy SPG, a good SPG and crappy tank, or something that's barely mediocre at both roles.
SPGs need a big gun with lots of ammo and space inside to load it fast and fire it at high elevations which means a yuge, tall turret that's hard to armor well, tanks need thick armor and lots of auxiliary stuff inside that means limited room in turret, SPG needs a rifled gun for range, tank needs a smoothbore for APFSDS and HEAT, and even if you did a miraculous balancing act, then you get the organizational shitshow with deciding how many of the hybrid vehicles should hang back near ammo stockpiles providing fire support, how many should fight at close range, and who should command which second rate tanks and SPGs.
So, why stick the artillery gun in a heavily armored, expensive and logistically tough to move around vehicle, when you may as well stick it on a relatively cheap tracked transporter chassis or even a 8x8 truck?