Can i swap my black iPhone 5 for a white one because of this?

My black iPhone 5's lock button stopped working from the right side, if i go to Apple store and they give me a new iPhone can i switch it for a white one?

No, you get the same model

Only if they are out of black. Otherwise you will get the same exact model & color.

But a word of warning you may have to pay a fee or deductible to replace the phone