removing mitochondrial read and unassembled "random" from multiple bam files
Your awk command is inside double quotes ("") which means that all of the awk field variables (e.g. $3) are being interpreted by the shell. Since $3 is not set in the shell, your awk is trying to compare an empty string and that's why you get the error:

awk: cmd. line:1: {if( != chrM &amp;&amp;  != chrUn){print ./index_sort.sh}}
awk: cmd. line:1:      ^ syntax error


Note how the error message shows if( != chrM and not if($3 != chrM. Since you need to use double quotes here because you need both an outer (for parallel) and an inner (for awk) quote, and single quotes can't be nested, you will have to escape the awk variables:

ls *.bam | parallel "samtools view -h {} | 
    awk '{if(\$3 != "chrM" &amp;&amp; \$3 != "chrUn"){print \$0}}' | samtools view -Shb {.}.bam"