Via the export url you can get the raw wiki text as txt-file. See
export_raw option at
https://www.dokuwiki.org/export
I don't know a fast way to retrieve all the pages from dokuwiki.org. Maybe the
tips: section at dokuwiki.org explains that somewhere.