This can certainly happen. I sometimes "supervise" M.Sc. theses at my employer. (The "academic" supervision is done by a professor at a university, of course, but I'll do the day-to-day supervision, and the student will usually sit at a desk in a cubicle close to me.)
Usually these theses involve my employer's Intellectual Property. Usually the student uses data from a client (and retailers are utterly paranoid about their sales data). Consequently, we need to have both our clients and our own legal department on board with this, and usually this means that all or part of the thesis will not be publicly accessible. Of course, the department and the student in question needs to be OK with this, too, but we haven't had any problems with this so far.
The supervising professors will then need to sign a Non-Disclosure Agreement (NDA). Again, I have never seen a professor balk at this. They usually leap at the chance of having one of their students do a thesis in industry.
You ask: "what if her future employer asks for her PhD thesis?" Simple. The same thing happens if a prospective employer asks me about samples of my work at a previous employer, which I cannot disclose because of an NDA. I tell them that I have signed an NDA and cannot go into details, then give a rough sketch of what I can talk about. This is commonplace in the workplace, and no serious employer should bat an eye. (Even a future academic employer should be understanding.)
This might work differently for a Ph.D. thesis, where you actually expect to generate publications, which will usually be the exception for M.Sc. theses. However, I'd expect that it would be possible to have parts of a Ph.D. thesis not available to the public, again with NDAs. And if the industry partner pays part of the Ph.D. student's salary, I'd expect most professors to be happy with the arrangement, assuming a good relationship between the professor and the industry partner.