Is accessing a content database is not a 'best practice' or 'advisable' or it 'should' not be done as Microsoft can withdraw their support if it is done? I just want to know if it 'can' be done in the worst case or it 'should not be done' at all.
As a best practice you should never access the database directly. You can create a lot of problems for yourself by doing this... even if just reading the content (SELECT) you can cause row locking issues which are hard to troubleshoot and will break parts of SharePoint.
If you need to access the database for any reason consider doing it on READ ONLY mode and/or using a backed up version that is not currently connected to your production environment.
There is almost always a quick fix for a problem that can be done by modifying the database but more than 99% of the time that is not the right way to solve the problem. If you would like to provide more details about your issue I may be able to suggest an alternative.
So, "should not" = "cannot" if you're talking production and an environment where invalidating support will cause you problems. If you have 3 users on a SharePoint foundation server running under your desk, then do so at your own risk.
If you really need to touch your content database you will need somebody from Microsoft to sanction this (and possibly send a tech on-site to do this). If you're large enough then you will have a TAM (Technical Account Manager) who would help you organise this through PSS (Premier Support Services). If the issue was important (Sev 1) then they would do it pretty quickly.
If you want to access the data for other purposes (i.e. reporting, investigation) just take a backup and run SQL off that.
I've found several instances where SharePoint leaves garbage in the database due to bugs, but you'd still need Microsoft to clean it up for you.