Do I need a domain for both of the apps or I can just embed them on one server and make them communicate to each other
What you probably need is a cloud hosting, then php can run on port 80 while python on 81 or any other port.
So 127.0.0.1 for php and 127.0.0.1:81 for python
How to make two web app talk to each other one developed with PHP and the other with python