Can someone give some explanation between these two kind of policies and for what kind of servers should they be used? I mean, for example depending whether I have a web application or a MySQL db, or an ssh port etc... Thanks in advance
Application Security Policies are provided by the ASM Module, and are specifically for protecting Web Applications (i.e HTTP/HTTPS, also known as Web Application Firewalls).
These policies inspect HTTP requests to ensure that they are compliant, and that attempts to attack the webserver or backend (i.e SQL injection, command execution) are blocked.
Local Traffic Policies provide some of the features of irules with a simple WebUI, and can be used to control things like pool selection based on request URI, or filtering requests based on client IP or HTTP method. This could apply to any sort of virtual server (obviously, if the request is not HTTP, then the HTTP selectors/modifiers cannot be used).
A simple Local Traffic Policy is usually used to apply an Application Security Policy to a virtual, but can do other things as well. You can also use a Local Traffic Policy to route different requests to one of several ASM policies.