It is possible as editor does that, it seems it quite easy to be done with Slate, you create window first which you need to do with this function:
You can get rederer via this:
FSlateApplication::Get().GetRenderer()
Window is also widget SWindow:
Inside windows you place SViewport:
If you have 0 idea about Slate, it is engine UI system initially made for editor, but it also can power gameplay UI (for example UMG is blueprint front end of Slate), here link for good starting resource:
This can be helpful to as it shows some slate stuff:
In the first function i give you as SWindow aregument you use SNew(SWindow) or better SAssignNew(MyWindowVarable,SWindow), as for argument functions you look up FArgument sub class in API refrence usally in bottom, but i give oyu links for SViewport and SWindow
Slate is weakly documented so ultimate example resource for is engine source code it self aspecially editor code, but no worries Slate works outside editor (it needs to power UMG anyway) so as long as you dont call any editor code you are ok.