Typically, no you cannot run this sort of extension on shared hosting. Keep in mind that base types require internal storage, input, and output functions (as well as indexing support, group by support, and the like) to be written in C, which is an untrusted language. C programs can do anything PostgreSQL can do from a security perspective including possibly spy on other users' databases.
For this and other reasons, you can't install C modules unless you are a database superuser and you should not have this sort of access on a shared hosting environment at least where you are sharing a postgresql cluster with other users.