It all depends on type of the threat and political system
Regular police is good against perpetrators who do hide themselves. For example, someone commits a murder. Usually, perpetrator would try to hide his tracks and will try to avoid police. Police investigators would focus more on detective work, and less on physically overpowering him. Of course, sometimes this could be expected in final phase, but usually suspect is outnumbered and outgunned without need for heavier weapons. Regular police is also good enough against smaller organized crime, one that would avoid shootouts with police, and rely instead on legal tricks, bribes etc ...
Paramilitaries are suited for perpetrators who do their deeds openly . Think National Guard, Russian Internal Troops, certain parts of French Gendarmerie (GIGN which could be deployed even abroad) etc ... In this case, perpetrators could be rioters, guerillas, even Mexican Narco cartels. Usual pattern of their behavior would be to attack openly, and then slip into hiding. Regular police is too lightly armed to deal with them, so heavier weapons must be brought to bear. At the same time, these paramilitaries do deal with civilians, so this is not strictly military operation. They need to recognize ans separate peaceful citizens who happen to live in affected area, from sympathizers and helpers of insurgents. This is actually hardest part of the job, where many counter-insurgencies fail .
Finally, military goes against heavily armed recognizable opponent. Traditionally, militaries go against other militaries . Tanks, artillery, aircraft, ships etc ... This is understandable, if your opponent has aircraft, you would need either aircraft or your own, or SAMs . In either case, operators would need to be trained and they are no longer policemen or paramilitaries, they are military specialists. On the other hand, military dealing with a village full of insurgents could be counter-productive. Their first instinct would be to soften defenses using air strikes or artillery fire, and that would cause civilian casualties which may do political damage.
Now, if we consider unpopular dictatorships, biggest problem for them could be popular insurrection. Dictatorships usually last when great powers support them (think Saudi Arabia, or Iraq until they invaded Kuwait) . Regular military could be a nice shiny toy to frighten neighbors (if you have the money for such toy), but it also could be used in a coup. What is needed is a loyalist militia that could be used both against insurgents and potential plotters in military, heavily armed with infantry weapons and maybe some artillery, armor and helicopters. Anything above that would be overkill, you would need technical specialists focusing more on their job then loyalty to the regime. Of course, regular police would be somewhere on sidelines, battling usual everyday crimes with outdated techniques.