In theory, you can use any student loans up to the cost of attendance minus tuition, university fees, etc. for anything you want to use them for (aka "personal expenses")
However, if you do so, then there's a reasonable possibility that you won't have any place to live, no food, etc. unless you have another source of income.
In other words, as suggested above, try to get out of debt before entering law school.