How can I get in my service class(Apex class) that a logged in user is having view all and modify all permissions on any particular object.
You can query the permissionsetassignment object to determine if a user has PermissionsViewAllData or PermissionsModifyAllData (I believe, check the documentation). See https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_permissionsetassignment.htm for more information.
Edit: You can also query for specific objects. The items mentioned above are the global permissions.