A barn means a number of things. I have a barn on my farm that houses my own horses, my tack, feed, and hay. It is solely for my use.
Many members refer to barns as interchangeable with stables. In reference to horses they are structures that do the same thing as my barn but do it commercially - even if it only one or two other horses. It can be a large facility housing many horses, giving lessons, training, rental horses, horse shows, etc. It may have an indoor arena, and outdoor arena, and/or other rings for training.
Each barn has different rules concerning training. It is up to the owner/Barn Manager to determine if they are the only trainers allowed or if they allow others to come in to give lessons.