Question: can wizards learn any spell 5e?
Answer: A wizard can "learn" spells from almost anything. The spells that you add to your spellbook as you gain levels reflect the arcane research you conduct on your own, as well as intellectual breakthroughs you have had about the nature of the multiverse.