There are many techniques used in project selection. one of which is the opportunity cost "This is the cost that we are giving up by choosing some other project". if we have multiple projects to choose from, we will choose the one with lesser opportunity cost.
It is worth mentioning that opportunity cost involves many factors other than just the projects price.
As an extension to this question, can you select a project only with the given opportunity cost ? Ex.
Project A = $1 mil (Should the project with the least opportunity cost (lost) be the best choice ?)
Project B = $2 mil
Project C = $3 mil
Project D = $4 mil
Typically for a comparison to be useful, you need to compare like to like. In this case, you've got a bit of an "apples vs. oranges" situation -- you have the IRR for one item, and the opportunity cost for the other item. You really can't say unless you know the same metric for both things that you're comparing.
Training for Project Management Professional (PMP)®, PMI Agile Certified Practitioner (PMI-ACP)®, and Certified Associate in Project Management (CAPM)®