Theoretically, yes. You can make WordPress run on a Heroku dyno, the platform’s version of a Virtual Machine (VM), but it is highly inadvisable because of three reasons:
- The filesystem is ephemeral, which means that whatever changes you make to your website will only last while your VM is active,
- Because of this, you’ll need an external, persistent storage like Google Cloud Storage, Amazon S3, or Azure Blob storage.
- Some WordPress plugins will behave weirdly because of reason number one.