Home automation using esp 32

hello.............. I had an esp 32 that can be used for switching home appliances locally using HTTP commands........can I control this esp 32 from the internet using another esp 32 connected to firebase that passes HTTP commands to the local network while taking input from the firebase..... pls help......if I am not clear I want to control my home appliances both locally and using the internet by using another esp 32 modules......