Allocation is allocation.
At the application level, there is no distinction between disk and tape as far as allocation goes, EXCEPT... that your installation may restrict you from doing tape mounts.
If you are able to browse a tape dataset in (say) ISPF Browse, then your code is failing. If you are unable to browse a tape dataset, then you don't have 'mount authority'.