There's some detail given on Pottermore about the nature of the portrait-making process.
When a magical portrait is taken, the witch or wizard artist will naturally use enchantments to ensure that the painting will be able to move in the usual way. The portrait will be able to use some of the subject’s favourite phrases and imitate their general demeanour. Thus, Sir Cadogan’s portrait is forever challenging people to a fight, falling off its horse and behaving in a fairly unbalanced way, which is how the subject appeared to the poor wizard who had to paint him, while the portrait of the Fat Lady continues to indulge her love of good food, drink and tip-top security long after her living model passed away.
However, neither of these portraits would be capable of having a particularly in-depth discussion about more complex aspects of their lives: they are literally and metaphorically two-dimensional. They are only representations of the living subjects as seen by the artist.
(Pottermore, Hogwarts Portraits).
It explains that the Headmasters are more lifelike because they are specifically trained to impersonate their subject and to replicate some of their qualities. However, portraits are essentially still charactures. They can't hold the nature of their subjects, only give a dim reflection that mirrors certain aspects of that person (in the eyes of the painter).
A Basilisk portrait certainly wouldn't be able to harm its viewers (although who could get close enough to paint it?). As for boggarts and Dementors, we have no canon proof to say for sure but I think that it's highly doubtful that a portrait could have any material impact on the real world. A portrait is just a shadow, a pale imprint of its subject that can't have an impact on people watching it in real life.