My understanding is that - at least initially - in Northern Ireland, soldiers arrested people as 'common law constables', i.e. using the legal power we all have to perform citizen's arrests. Things may well have changed over the years, with other powers being established.
In the USA the National Guard is - unless embodied into it, for foreign wars - not part of the United States Army, but comes under State control, as their militia. And State Governors can and will call them out as they think fit to support the ordinary police.
The problem with using soldiers in a police role is that they tend to think they have to do something (seeing people as in some sense 'the enemy'), whereas ordinary police are perfectly happy to do nothing more than observe law abiding people going about their business.