You absolutely can do what you want, and there are many ways to do so.
One way is to use the cloud APIs. You can have your Photon connect to the cloud and either publish data to the cloud or register functions that can be called. Then your Android / iOS device can call those functions and query data or ask your photon to do stuff. You can look at the source code for the Tinker app – which is the built in one – that shows how to add functions. Then, there are APIs for Android and iOS to access your Photon over the cloud.
Another way you can do it is to use TCP/IP directly from your Photon. For example, you can have your Photon pretend to be a web server and talk to it directly from your mobile app. Of course, you’ll have to worry about firewalls and NAT if you’re trying to reach it over the Internet, but if this is all happening over a local WIFI network then it should be straight forward. You can look at some of this documentation in the firmware section:
There are other ways as well, but here are two to get you started.