Are dentries and inode table same thing? If not what is the purpose of each and where are they stored? How does the filesystem exactly work specifically "ext4" or "xfs"?
The inode table is simply the data structure that contains all the inodes. On ext4, it's a linear table, split among the block groups (with a constant number of inodes per block group).
There isn't much connection between the inode table(s) and dentries than what the already is between dentries and the inodes themselves.
The question about how the filesystems work is much too broad to answer here. There's a description of the ext4 filesystem format here: https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout
There's probably some description of XFS online too, but I don't particularly know of any good resources.