Bacterial vaginosis, as you know, is an imbalance in the composition of the bacteria that normally live in the vagina. Symptoms can include vaginal itching and discharge which may be copious and may have a bad smell.
Although vaginal hygiene can play a role in developing bacterial vaginosis, it is unlikely that not changing your underwear for a few days will put you at a major risk, especially as long as you stick with absorbent wicking underwear. In fact, bacterial vaginosis is actually more common on the other end of the spectrum - in women who over clean the vagina by using chemicals or douching methods. Both chemicals and douching mess up the balance of the normal vaginal flora and lead to a higher risk of bacterial vaginosis.
Another major risk factor that contributes to the development of bacterial vaginosis is smoking, and you could consider smoking cessation both for this and for other health reasons if you are a smoker.
Finally, there is some evidence that taking a lactobacillus supplement may help to prevent bacterial vaginosis, so this is something else you could consider for your hike.
If you have any other general health questions, please ask your primary care doctor