At one time studios (major ones) had their own armory, but today most guns are obtained from rental sources. Same for big stuff ... GI vehicles, tanks, artillery ...
Also in movies where there are a lot of arms ... most are non-working replicas. There are only a few working guns and the rest is just "artful" film making.