I think some are confused. I highly doubt... Nay I assure you and would bet my next paycheck that there are not "thousands" of competitive shooters running 40 cal ammo out of a 10mm barrel. They may have a 40s&w barrel dropped into their 10mm pistol, and that makes sense. Larger frame, more mass, should soak up recoil better than a standard sized firearm in 40s&w.
As to the original question, yes 40 can be fired out of a 10mm barrel. The same way 380 or 9mm mak can be fired out of a 9mm. I've experimented with this in the day, mostly to see what might work in a pinch. It is a VERY bad idea to routinely fire 40s&w out of a 10mm barrel. Its not interchangeable like revolver rounds. John fairly thoroughly explained it, but didn't follow up with the possible danger posed by a build up of shavings in the chamber. Firing that short round for the chamber will likely shave some metal off the projectile as its fired, whereas firing proper ammo will chamber the projectile past the chamber mouth and into the throat. If you try to try it like a 357 revolver where some routinely fire more 38 than 357, you could have very real problems. If you fire several hundred rounds of 40, then switch to full house 10mm, there may be enough of those shavings built up in the chamber to prevent the 10mm from head spacing properly. This could mean the round doesn't fully seat in the chamber, the brass isn't fully supported, and you could have a case rupture. It may be a more extreme example but it could happen.
If you want a switch caliber gun get another barrel. If you need to fire 40 out of a 10mm barrel in an emergency, I wouldn't hesitate. It shouldn't be a common practice though.