As you said your desktop version of website is redirect to example.com/index.do
when you just open the example.com
URL.
So here you're doing 301 redirection, which means even if you setup other canonical link tag like https://www.example.com/
, then it will be overwrite by 301 redirection, which means Google will index https://www.example.com/index.do
in their search result pages, not your prefer canonical link tag.
So always set canonical link tag which is your destination URL or to redirect URL.
In case of mobile, you already doing 301 redirect to mobile version of site automatically, so you don't need to add alternate meta tag which is mention by Henry, but here if you're not doing 301 redirection and using other technique to do redirection then it will be major problem, that time you can use alternate meta tag.
To check how Google see your mobile site use fetch and render tool, and add your any desktop version URL for check and select Google Smartphone crawler and if it redirect to your mobile version then everything is fine.
In mobile site also don't forgot to use mobile version of canonical link tag.
I am not expert in HTTP rewrites rules, but by using that you can serve your index.do page directly in your homepage, and hence you can index your clean homepage URL in Google search result pages.
index.do
portion necessary? Usually the index document is the "default" document and it will show up if you omit the document name and just end the URL in the slash.