How to edit the headers of multiple fasta files from multiple folders?
You were so close! This should do the trick:

for i in {314..727}; do 
    sed -i.bak "s/^&gt;/&gt;${i}_/" mgm4761${i}.3/*.fna
done


Note that I am using -i which makes sed edit the original file. Because I use -i.bak, this will create a backup file with the original data. Once you are sure the command does what you need, you can delete all of these files with rm */*fna.bak.