Pulsars as astrophysical laboratories for nuclear and particle physics