How could Yosef put himself in such a dangerous situation, just for the mitzvah of Kibbud Av (honoring his father)? We know that there are only three mitzvos of which we must never transgress, even at the threat of death: murder, idolatry, and adultery. While honoring one's father is very noble, we are not required to give up our lives for it.
On the contrary, according to many opinions, we are not allowed to give up our life for a mitzvah that is not one of the Big Three!
So how could Yosef knowingly go to his brothers?
Yosef felt that it was worth it to show his brothers the ends he would go to, to honor his father's wishes.
Yosef saw that his brothers lacked the proper respect for their father, Yaakov. Yosef was right. The main reason his brothers hated him was because their father loved him in particular. They should have respected their father's love, but they didn't.
In such a case, if your motive is not for the mitzvah itself, but to strengthen your fellow Jews' observance of Torah and Mitzvos, such an act is permitted. (As an example for this, we see that the Mekoshesh Eitzim gave up his life in order to show the Yidden in the desert how severe it is to break the Shabbos.)
This ultimate level of self-sacrifice is also a prominent part of the story of Chanukah.
The law requires Jews to die, rather than transgress certain mitzvos. Were the Chashmona'im, however, allowed to wage war on the Greeks?
The simple answer is that which we have discussed already. They were proving to the Jewish people that Judaism and G-dliness is worth living for, worth fighting for, and worth dying for.
This ultimate mesirus nefesh was rewarded by Hashem through the finding of the pure olive oil they could use to light the menorah. Although according to various laws, the Jews would have been Halachically permitted to light the menorah with ordinary oil, they miraculously found a jug which still had the Kohen Gadol's seal on it. For their greatness and ultimate self-sacrifice, which went above and beyond the letter of the law, they got the purest and greatest type of oil, which also was beyond the law (as mentioned, they could have lit with regular olive oil).
-From a sicha I learned today, waiting for my chavrusa, in Chelek Lamed Hey.