Minecraft wiki entry for Target_selectors, associated text: Bedrock Edition can use @r to target non-player entities via the type selector argument; in Java Edition, to select a random entity, use @e[sort=random] instead.
In Bedrock Edition, @r can only target entities who are alive.