Variable...
It seems to be very variable between airlines as to whether the use of GPS units is permitted in-flight. They do, at least, usually list them in the inflight devices information these days.
As to whether they work or not, it can take quite a while to get a fix (from a cold start, I expect because downloading the almanac is marginal) but once fixed the position updating seems to work OK. It's usually necessary to hold the receiver by the window, and at the window most GPS units seem to see 4-5 satellites.
On airlines which permitted it at the times I was onboard, I've used both hand-held dedicated GPS units and GPS units in a mobile phone and got a position fix, as well as a plausible ground speed and altitude. I should note that the phone I used was capable of having the mobile phone transmitter offline ("flight mode") while having the GPS receiver on - clearly one would not want to use a phone that cannot receive GPS without transmitting mobile phone signals as that would be against regulations.