Every community has a distinct traditional dress code which is specific for them. It serves as their identity. For example, the community of Sikh who wear turban everywhere they go, it is their identity.
Wearing turban is also the tradition of Muslims, hence there is no matter of restriction in wearing it. Since India is a democracy, everyone has equal right to express himself and the identity of the religion he belongs to.