You CAN do whatever you like. That doesn't mean you should.
The Electric Code is concerned with premises wiring materials and methods, a piece of moveable furniture is not covered by that, so you are on your own. Your plan is "workable" but has some inherent dangers that we cannot see, chiefly the mounting orientation of your receptacle and the type of wiring used and how that is connected as previously mentioned. When using "portable cord" like SJO cord (which would be best), you need a "strain relief" connector for where that goes into the box so that when someone moves the nightstand, it doesn't pull on the electrical connections to the outlet.
The outlet you posted has "back stabbing" connectors, those will NOT work with the stranded copper wire you get in portable cord, you need to use the side wiring terminals, then use fork-tongue crimps on your wires.
If I were doing this, I would use a GFCI receptacle, just to be safe. You can get those with USB outlets too.