Sure, but then you'll be locked out of apps and sites that enforce device integrity.
I guess the best option is two android phones, one for Google's locked down junk and another that is allowed to run your own code.