You're thinking of the "Hell's Gate" series. Bestselling author David Weber takes half the credit for it, but he changed co-authors between the second and third volumes. The books that have seen print are:
- Hell's Gate (2006, David Weber & Linda Evans)
- Hell Hath No Fury (2007, David Weber & Linda Evans)
- The Road to Hell (2016, David Weber & Joelle Presby)
If you click on the link for the first book, it will take you to where the first 12 chapters are available as a free sample on the Baen website. That ought to help you confirm that the material looks familiar. Meanwhile, here's a cover-scan of Hell's Gate:
The general idea is that there are two parallel Earths on which human civilization has arisen. (Neither of them is our world, although they have the same continents in the same places.) One is called Arcana (with a heavy emphasis on magic spells), and the other is Sharona (which has highly developed psychic Talents among its population -- something the Arcanans either don't possess, or simply have never learned how to identify and develop, perhaps because they were too busy developing the subtleties of spellcasting). The Arcanans also use dragons as powerful assault forces which can fly through the air and breathe fire or other nasty effects (depends upon the breed of dragon, I believe) to smite their enemies. The Sharonans put their faith in heavy artillery, such as existed around the 19th Century in our own world. The Arcanans, as I recall, have never discovered gunpowder! But the Sharonans never had the chance to domesticate any dragons, so there's a steep learning curve for both sides as they learn -- the hard way! -- not to underestimate what the other side is capable of doing after it's had time to move its "heavy hitters" up to the front lines.
As the first novel begins, the two human homeworlds have never even heard of each other. Apparently each world is linked by portals to other parallel Earths, which in turn are linked to other parallel Earths, etc. The portals are not something that can be turned on or off; they simply occur "naturally" (as far as anyone can tell). New ones open up from time to time, which helps explain why systematic exploration of new worlds (for both civilizations) has only been happening for a matter of generations, rather than for millennia.
And there's no guarantee that multiple portals will conveniently be located close together (although sometimes they are). Suppose, for instance, that you find a portal in the equivalent of Ohio, and it takes you to a new world. Then suppose the only other portal in that world is in the middle of the Australian Outback. It's going to take you quite a while to find that other one, isn't it?
So what it comes down to is that for a long time the Arcanans have been using portals to explore and colonize other worlds which have plants and animals, but no indigenous humans to give the colonizing efforts a hard time. The Sharonans have been doing the same thing. Each side has come to believe: "We, and we alone, are the only sentient beings in the entire multiverse. Obviously, we are destined to rule all the worlds we can find! Our only competition is ourselves!" (As in, rival political factions, or neighboring nations, or whatever, back home.) It's a nasty shock to discover that they have each been completely wrong.
Out in a newly-discovered world that's many portal transits away from either homeworld, one armed man (with a rifle), from a Sharonan expedition, bumps into one soldier (with a crossbow) from an Arcanan expedition . . . and they both shoot. One man dies quickly; the other makes it back to his unit's base camp to gasp out a few words before dying of his wounds. No one (including the reader!) knows just who fired first, what with there being no surviving witnesses to testify about the precise sequence of events.
The colleagues of both dead men become very nervous about what's going on, and things escalate from there; in large part due to one very dumb military officer. If he had not been present, the other leaders of the two groups might have been able to make "first contact" on a more diplomatic basis, despite the initial language barrier, and despite that unfortunate one-on-one shootout. But it didn't happen that way, so the less militaristic of the two exploratory groups gets the worst of it. Two of them are a married couple, both Talents (psychics), who get captured and transported back to Arcana. (Passing through many intervening parallel worlds on the way.) That's the two scientists you mentioned: Shaylar and her husband Jathmar. The war that begins in Book One continues full speed ahead in Books Two and Three (and I suspect it won't be wrapped up for at least a couple more volumes, if those further installments are ever completed and published).
Ended with the marriage of the female heir to the throne and
subsequent destruction of her ship by her fathers' enemies and her
being attacked by sharks and defended by whales.
That sounds like something from much later -- Book Three in the series. I don't own a copy of that one, but I once looked through someone else's copy. Imperial Princess Andrin was on her honeymoon when the ship was attacked by commandos working for another Emperor who hated her father's guts. (Mainly because her father had recently been accepted by everybody else as the overall ruler of all of the planet of Sharona and its various colonies, and the other guy felt he'd been cheated in the process.)
As you said, sharks were ready to eat anyone who fell or jumped into the water during that commando raid (such as Andrin and her new husband), but I believe it was some friendly orcas that gave her a boost up out of the water and into another boat before the sharks could get to her.