I'm making a ROBLOX script that only allows the script to work IF the script has a certain ID in it, and the ID can be removed from a database if the person misuses the script.
Is it possible to hook a ROBLOX script to any kinds of database? If so, what database and how?
Yes, but not directly. You'd need to implement some kind of HTTP API that would allow you to interface with the SQL server, eg.
http://example.com/isIdAllowed/12345678
There are a plethora of platforms for web development. I'd personally recommend Node.js, which uses JavaScript, a language very similar to Lua. You could also hook yourself up to something like Firebase, which has a REST (HTTP) API. The only problem with Firebase is that it uses other types of HTTP requests besides just GET and POST, so you'd still need to proxy it through your own server. I'd also point you to this answer, also by me, to a similar question.
One more thing. If you expose an API to remove the ID's, like this:
http://example.com/deauthID/12345678
Or do anything else sensitive that you don't want unauthorized parties doing, make sure that only you can do that from your own places. This article has some tips for keeping HTTP APIs secure.