This article is from the Star Trek Tech FAQ, by Joshua Bell inexorabletash@hotmail.com with numerous contributions by others.
Yes. Although done numerous times, including "Ship In A Bottle" [TNG]
and "A Matter of Perspective" [TNG], and "The Siege" [DS9]; "Hollow
Pursuits" [TNG] is the prime example of this, and brings up the
question...
"Is it ethical to simulate someone without their permission?"
Systems of ethics are by no means universal across cultural lines. Nor
can we extend our 20th century foibles to the 24th century, where such
things may be common place. In every instance, however, people thusly
simulated have reacted negatively when they find out - for example,
Troi, Riker, and Picard in "Hollow Pursuits" [TNG] and Dr. Leah Brahms
in "Booby Trap" [TNG] and "Galaxy's Child" [TNG].
"So does the computer stop these simulations?"
Nope. Moriarty was able to do it in "Ship In A Bottle" [TNG], without
any special permissions. It is amusing, however, to watch the episode
again, and see how the simulated characters appear slightly stiff.
 
Continue to: