That's an extremely broad request. From what source format? With or without replies included? As an import tool on a new forum or to be run in production? With or without duplicate detection, and if so with or without merging replies?
There are many possibilities depending on the actual use case. Many of the simplest processes can already be achieved using Flarum's REST API. For more complex use cases extensions will be able to do it, but it'll likely be specific to a use case.