I assume you are referring specifically to Imperial boarding tactics.
Well, when the Empire just wants to oppress people and board anyone they like, there is the thing called a tractor beam:
A tractor beam was a projected force field that manipulated gravitational forces to push or pull objects. Such devices were employed on some vessels, creating an energy field that allowed them to lock onto and move other vessels or objects.
Basically, a successful tractor beam lock will wrest control away from the target ship, allowing the firing ship to move the targeted ship into position for docking.
Beyond that, it is also possible to remotely hack into a ship for control of the ship's computer systems. This opens up new possibilities for a boarding party: The door can be made to open without blowing it up, for example. Doors can also be remotely operated to provide the boarders with tactical advantage, while sealing off the defenders from retreat or reinforcement.
So what happens once the ship is docked, the door is about to open and the stormtroopers are ready to storm? Yes, it's always going to be difficult to not score casualties, but don't forget that stormtroopers are militarised police. Their most frequent non-Rebel targets - smugglers, dissidents who are all talk, friends and families to be taken hostage, baby Jedi - aren't equipped nor trained to fight an organised military force. Even the Rebellion has to make do with whatever tech and recruits they come across - any good technology or men they get hold of won't be relegated to guard duty, they'll be doing special operations like stealing Death Star plans from under the Emperor's nose.
When it comes to full-fledged battle, however, boarding tactics are likely retained from the Clone Wars era. The enemy ship will be fired upon until it is crippled: Shields down, hyperdrive and preferably engines taken out, breaches to the hull or to hangars made. Once the defences - guns and fighter complements - are sufficiently softened up, the troop transports are brought in to land and seize the ship by force.