Mixing of spin and orbital angular momenta via second-harmonic generation in plasmonic and dielectric chiral nanostructures