A moose weighs nearly a ton and can smash through your windshield in a collision, so running into one is genuinely dangerous. The first thing you need to do: start smoothly reducing your speed right away. Don't go to extremes - neither hard braking with screeching tires nor trying to swerve around it. The animal is unpredictable and might jump right in front of your car at the last second.
Turn on your hazard lights and headlights, give it a honk - sometimes that works and the moose will leave the road. If the animal is standing there looking your way, don't try to creep past it like you're in a parade. It's better to stop completely in a safe spot if you can and wait for it to lose interest and wander off on its own. Usually they're not aggressive toward cars, just slow to make up their minds.
If a collision is unavoidable, then yeah, keep your car straight - that minimizes your chances of skidding off the road and flipping over. The key thing is maintaining control of your trajectory, not attempting some miracle maneuver at the last second.