To my knowledge, it can only be done using apps that will basically emulate the Android Bedrock version.
I set this up on my Steam Deck so I could play with my ex’s son. I bought a copy on the Google Play Store and then I signed into Google in an app on my Steam Deck which downloaded Bedrock and then let me play, even using the Steam Deck’s native controls.
That is the only way I am familiar with from my research.
Microsoft has blocked Bedrock on desktop OSes besides Windows. I have tried on my Mac and Linux computers with this being the only successful way. You can play Java through their app without issue or jumping through hoops like this.