I noticed in some books I read that under each chapter title, there is a citation, somewhat related to what the chapter in question is about. I was thinking of maybe using the same technique for my (first) novel. I have no experience in creative writing and so I was wondering whether this is frowned upon or generally accepted? Are there any legal considerations when quoting somebody in a book?
This is widely accepted, a rather common "flavor".
Yes, there are legal implications, unless you use public domain works or made-up citations.
In case of citations from works still covered by copyright, such use is not covered by Fair Use clause (unless you're parodying the content of the citation in in the following chapter, or referring to it by some other Fair Use clause) so either you obtain permission from the copyright holder (not always for free, not always granted at all), or you just violate the copyright.
While such minor copyright violations are hardly ever pursued by the copyright holder if the work is niche, you're likely to hear from their lawyers if you publish a popular book that earns you significant profits.
...that's why you'll usually find the quotes from Shakespeare, authors good 200 years old, or ancient philosophers. Quoting a modern pop song lyrics is asking for trouble.