Most airlines would not allow it. Reasons quoted are various.
Firstly, without being shielded and earthed to the airframe, it is difficult to quantify any interference with the aircraft's electrical equipment.
There is also the risk that a potential hijacker/suicide bomber is using one to check position before triggering a device or making his move...
It probably seems unfair to a genuinely interested amateur or spotter, but I have to confess that I would not be happy knowing that someone in the back is plotting our exact position. Apart from anything else, they'll know when I've got lost, or I'm bull!!!!!ting in my enroute PA announcement!
------------------
Breeding Per Dementia Unto Something Jolly Big, Toodle-pip