I think the Android approach is: the back button usually does what you want, unless what you want is consistency.
Thoughtfully designed apps tend to set up clear expectations and deliver on them. Thoughtless or malicious apps can be confusing or intentionally mislead.
Apps get to decide what metaphor makes sense for an "action" (maybe it's a page, a screen, a dialog, etc). But users can be confident that the "back" button always takes them "backwards", even if the metaphor various apps use may differ.
Users can feel reasonably safe that the "back" button will take them "back" one 'step' or one 'action' worth, even if the app is using panels instead of pages, or modal dialogs instead of inline alerts