There aren't any countries where secondary education is truly *optional* in the sense that there are no legal requirements or significant social pressures to attend. While some countries may have lower attendance rates than others, this is usually due to factors like poverty, geographical isolation, conflict, or weak educational systems, not because attendance is optional. Even in countries with high dropout rates, there's often some level of compulsion, though it may be poorly enforced.
The idea of completely optional secondary education is unrealistic, as it would likely have severe negative consequences for the economic and social development of a nation. Secondary education provides crucial skills and knowledge for future employment and citizenship.