Hi, thank you for contacting JustAnswer.com. My name is Russell. I will do my best to provide the right answer to your question.
You may have to install Android OS onto the tablet from scratch, by the sound of it. This may be difficult and I am not sure of the procedure, to be quite honest.
What version would you want to try installing onto it? is the next question.
I think that either 4.4 or 5.x would be the choice to make here, but I am not sure whether your device came with 4.4 or can support 5.x.
Note that if you install the lower versions of Android, there is, as originally issued, a bug in all of them. This is with reference to your suspecting that the Android OS install that failed, may have been affected by a virus:
If your device has the Android OS on it, then if that OS version is not sufficiently updated, then it may contain a significant 'security hole' that allows almost anyone to gain access and control over your phone. Or install malware, spyware, etc. on it.
To test as to that security hole, download and use this app:
to tell whether there is such a security hole in your phone's Android operating system.
To avoid the problem in the first place, not just using the Stagefright detector, but also completely updating your Android OS ab initio when you first start using it, is a good idea.
(Some older versions of Android OS cannot be patched, by merely updating that version... but a higher version, if it can run on the older Android OS -compatible phone, can cure that problem.)