Can I use android tablet as a handsfree or headset bluetooth device profile ? Status in 2018
Both sides of Bluetooth handsfree profile (they are called handsfree unit, HF and audio gateway, AG) are implemented and present in Android source code. As a developer, you can develop firmware supporting HF, or AG, or even both (automatically or manually selecting what role will currently be active). But generally, firmware developed for smartphones and tablets supports only AG role and firmware developed for car head units supports only HF role.      

I have not tried to search such information, but possibly alternative firmwares for specific tablets with dual roles support exist. There are no serious difficulties to implement it at a firmware level. But I am not sure that the implementation of standard second role at the application level is possible.
Upd: It can be difficult to support dual roles if audio streams are processed and routed by hardware, and there is no default streaming for one of roles.