Is it possible to create a task in buildSrc?

You can, it is just now shown in IntelliJ integration.
buildSrc is a bit special and when requesting the tasks for the parent project, Gradle does not deliver the buildSrc tasks to IntelliJ.
If you switch from buildSrc to an included build, it should work like you expect it to.