While you may have certain genetic predispositions to bunions (e.g. ligament laxity), it is highly likely that there are also environmental and behavioural factors contributing as well, such as narrow/rigid/heeled shoes and a sedentary lifestyle. Either way, if you have bunions now then surgery is not the only option - it is always best to trial a period of consistent foot strength and mobility training along with a transition to wide/flat footwear. Many people can improve and even reverse thier bunions in this way. If you do end up needing to have  surgery, then taking this approach first will mean you’ll already be in a better position to recover and prevent recurrence.