I've read about British army officers, for instance, becoming observers during the American civil war and the Russo-Japanese war.
I have been wondering this as well. In The Killer Angels the Army of North Virginia had several European observers attached. Their origins included England, Prussia, and Austria. How common of a practice was this? Why were these foreign observers allowed?