Recently updated CRM from 2016 Online to Dynamics 365, Users were unable to login Dynamics 365.
Tested the same User login with the same security roles in CRM 2013 and 2016 environments, not facing any login issue.
Finally found that in Dynamics 365, it is mandatory to have Organization Read Level permission on Organization Entity for a security role, and which is not mandatory in other CRM versions.
Issue resolved.
Hope this helps 🙂