Nick here from Shopify.
You can sell a digital product (ebook in your case) via POS as well as your online store. Something to note is that you would need the Digital Downloads app made by Shopify to enable your store to do this. There are some other digital download apps you could look into using for this also:
Regarding your question about whether it is necessary for your product to be a physical product to be able to sell it on Facebook. All products which are sold on Facebook must require shipping, so you wouldn't be able to sell any digital products through the Facebook sales channel. Shopify has a guide going through all the product publishing requirements for the Facebook sales channel which you can read here.
Hopefully, this helps and answers your question.
All the best, Nick