Yes, why not.
Only problem is that canvas creates very large filesizes and local storage has a size limit. For production keep limit the use of local storage to 2,5mb. That should cover most browsers.
A better solution would be to post the data url to a server and retrieve it later.
Check it out yourself, compare filesize of your canvas created png to the filesize of optimized png's data url