You certainly can paint the door the same as the wall. The main problem with doing this is the door frame color. Do you keep it the same color as the rest of the trim or paint it the same as the wall? It would look better if the trim is kept the same as the rest of the room; base, door frames, casing, etc.
Traditionally all doors and trim are the same through out a room or house. But there is no reason to be traditional. Go ahead and paint the door the same as the wall and leave the frame alone. Now see if you like it. If not, it is easy to repaint.