No, it is not illegal to dress like a pilot. Airlines have very specific policies about where you are allowed to wear uniforms. Basically only while flying. You wear uniform going back and forth to hotel, in the van, waiting at airport, and on the plane.