Tailored polarization of optical propagation in heterostructured nanowires