You can do anything and use pure C++ code whenever you want. There is nothing limiting you in any way that I can think of. If you get compilation errors that you dont understand, try the following two things:
- Compile from within the editor.
- Remove all user generated macros like UE_LOG(). Macros can cause the error to be move faar away from where the problem actually is.
Every time you use a macro, compile and check that it works.