Is there any way to scale a ped up or down in GTA V/FiveM at runtime

This is not an official feature. I personally found out that this works by total accident. It is extremely limited as it only works with peds and objects. It needs to be reapplied every time something happens physics wise. And animations can often break this behavior completely. E.g. entering a vehicle.

The code example I shared is just for showing that it works. There is a lot more to it if you want to make it work more flawlessly