If I can access bubble of Messenger like apps from home screen then does it not mean any other app can also access that app? Is Android safe then? In Android phones, we can access Messenger and many more apps similar to it from home screen ( like bubble-heads, lyrics etc). With this we let one app in your phone access another app, (we can use messenger chatting from every app in an android phone).

So if the other app running uses this information taken from a app which is running through bubble-heads, won't that be dangerous?

Does android have any security measures to prevent this?
Messenger bubbles are an overlay. Messenger isn't actually interacting with the app running in the background, it's just drawing over it. Even this is a permission that can be denied. 

Android as an operating system is secure, but like all systems, it's as secure as the code running on it. Android sand boxes apps and only allows them to interact with each other through the system in predefined ways ( ex: intents to share or open with another app), and has a robust permissions model to boot. 

However if you use an app that wants permission to read your messages (like an SMS app), and you grant it that permission, then if the app does something malicious with that data, or the app itself is not secure, then it's not really the operating systems fault. 

Like I said, a system is as secure as the code and applications you choose to run on it.