Sometimes on a sajdagah, a layer is formed due to repitition of prostration and it darkens. is namaz valid on such sajdagahs?

Yes generally it is okay. If you feel that this layer is too thick and you are not doing sujud on the soil anymore but on that layer you should clean it or change it