Yes, it's legal.
The thing to remember is you're not replacing lost pieces. You're literally promoting the pawn. It's still the pawn (kind of) but it can move like any other piece you want (other than a king).
So you can also have 2 queens (up to 9!) Bishops of the same color, etc.
this came up in a forum conversation, and I simply don't know the answer. Say I have a light square bishop and I promote a pawn on a light square. Can I promote to a bishop and have two light square bishops? I realize that I could just as easily promote to a queen, and not face this dilemma, but I guess there could be a situation where promoting to Q could produce an immediate stalemate draw, where promoting to bishop would not. Is it legal to have two bishops of same color, one which was attained by pawn promotion?
Some people may laugh at my question, but you're not born knowing these answers, and you have to learn them somewhere. I looked it up on google search and have not found the answer there.