To some extent. The movie takes inspiration from the events and persona of Al Capone but may have fictionalized certain aspects for dramatic effect and entertainment purposes.
The book is definitely fiction. It weaves an imaginative tale that is not based on real events or people. The author crafted a fictional world to engage and entertain readers.