Hot glue will bond to just about anything, but that doesn’t mean it’s like crazy glue. For example, while you can use it on smooth, non-porous surfaces, when the melted glue goes on, there are no crevices for it to hang on to. Your item will stick, but you will also be able to pry it off (which may actually be a good thing if you are adhering something temporary). On the opposite end of the spectrum are things with a rough, loose surface. The glue will bond to what it touches, but may then pull away after time.
If you are working with glass, either use low temp glue and/or make sure the glass is at least room temperature. Hot glue on cold glass may cause it to shatter. If you are working with things that melt with heat, like plastics and Styrofoam, you always want to do a test first to see if it melts when you add the glue. It is likely that you will need to use low temperature hot glue sticks.