Are keen to buy Sea of Thieves but it costs 40 euro but with the Xbox Edition only 20 euro discount and as I understand it you can also play with this edition on the PC or how does it work?
Sea of Thieves is an Olay Anywhere game, yes, it means you can buy it once and download it on any platform where it is available and then play it.
I would advise you not to pay 40 or 20 euro, for less money you get the Xbox Game Pass, with which you can download hundreds of games (including Sea of Thieves) without actually having to pay for them, all you have to do is to pay for the monthly one Pay amount.