You can, but you have to put the UENUM at namespace level.
However that is not recommended. See guidelines here.