Yes, definetly. Local building even opens you the full power of the open source repo and ability to even tweak the system firmware and at no cost for any of the libraries that are freely available too.
Just as with the WiFi devices you don't need the Particle cloud. You can do anything you can do with TCP/UDP and - although I think it's not fully electronified yet - the "local" cloud server would be a possibility for you too.
TCP/UDP are up to you for security, local or Particle cloud are encrypted, but for details someone else may have to fill in here.
One thing to bear in mind is that the photon/core appear on your local lan first, so “local” can really mean local; however the electron appears on the carriers network, so it is already effectively at some random point on the internet already, so any non-particle cloud implementation needs to be available to the internet.
Apologies if this is obvious to everyone, I’m not intending to insult anyone’s intelligence here.