Yes, you can buy Xbox gift cards online through the Nosh app or website.
Just log in or sign up if you don’t have an account. On the homepage, go to Buy Gift Card, select the country of the gift card, select Xbox as the brand, choose the amount and quantity you want, and get your code instantly after payment.