Can I put a receptacle in a closet?
Yes you can.  I have three instances in my house:  all were signed off by a competent electrical inspector.   (I am in the Portland, Oregon area.)

There is one in a bathroom closet, and one each in two medicine cabinets.  Handy for recharging a cordless vacuum, electric toothbrushes, and an electric shaver.