Is it allowed to do?
No, this is not allowed in general for images, or in fact any content that you discover online or anywhere else.
To use an image in a question or answer, you need to be the original image author, or to have been given copyright that is compatible with uploading to Stack Exchange.
The Stack Exchange terms and conditions include a section on content permissions and this has a section called "Subscriber Content" which covers this in detail.
In short, all content that you post - any question or answer - is licensed to the Stack Exhchange by you under a Creative Commons v4 license. You must have the rights to do this, otherwise you are in copyright violation (and so is Stack Exchange, but they can hold you responsible).
As well as being an image author, you may have received it in a way that means it is OK to re-use it in Create Commons content. For instance, it may be public domain or already licensed as Creative Commons or compatible license.
If you are not sure about rights to re-use an image on the site, then you have a few options:
Link the image where you found it, don't embed it.
Contact the image author and ask.
Search for a similar image that is Creative Commons already. Google image search allows you to do this, and Wikimedia Commons allows you to search for images on its site that might cover your needs.
Re-draw your own version.
A lot of people do not understand the fine details of copyright rules. That also means that a lot of technically invalid content gets posted, and also that a fair amount of that is de-facto OK, because the original owner does not mind (they just don't know or care about the licensing to do the work to share legally). However, the safe advice is to not use images that you are not sure about.