Whether you can or can't downgrade your iMac and to what macOS version depends on the exact iMac you have... which you don't tell us. (e.g. Model date code name, model humber, or EMC number, or better all three).
But better still look it up for yourself online. e.g. try here
https://everymac.com/systems/by_capa...supported.html
But either way, I would get off Pro Tools 12 onto something from this decade.