Yes, it is possible to write policy decisions based on the X-Forward-For header, provided that this header exists on arrival to the proxy.
The most efficient method is to include the condition in the local policy file:
request.header.X-Forwarded-For="test"
Replacing test with the appropriate value.
You can also use the VPM: select the Source object and set it to New > Add Request Header Object. Add the X-Forwarded-For header.