Kinda depends on the gun.
And you can generally MOVE DOWN in caliber, but seldom up. (Witnesses are one exception.)
With some guns, like SIGs and maybe Berettas, all you need is a special Bar-Sto barrel which makes it all work together. (Bar-Sto can adjust the barrel so that headspace isn't a problem, the round works with the .40 extractor, etc.) I know of several folks who have done this.
With Witness small frame guns, all you need is a different factory barrel. (The mags are generally interchangeable -- as it the case with many guns.) But the Witness guns are designed this way, from the start. The 9mm and .40 have the same barrel diameter, for example, which would not be the case with most guns.
With a 1911, however, you've gotten into a different world.