You can absolutely develop a Magento extension as you described
In fact, there are already extensions like that you can read more to contribute to your own module
Take this extension as an example: Multiple Store View Pricing for Magento 2 . This module helps to set up base currency for each store view and customers can also checkout with that store view currency
As you know, Magento default just allows checking out with default base currency US Dollar although you can set up display currency comfortably. Like your above instance, when developing such an extension, users coming from Canada can use CAD to pay and users from France can use Euro for payment.