Can we go to Glacier National Park and Yellowstone National Park during the same trip?
Montana is a big state. Yellowstone and Glacier are both about 200 miles from Helena, MT in opposite directions. So yes, you can go to both in one trip, but it's a lot of driving and a fair amount of planning.
Bears?!
Yes, there are bears and yes, if you're hiking or generally outside of city limits, you just might see one. Long story short, carry bear spray and be aware of your surroundings. Below is a good resource.
https://fwp.mt.gov/conservation/wildlife-management/bear/be-bear-aware