There absolutely are such machines and we call them computers.
> Should people be allowed to install it?
Communication is the powerful 'technology' that changes people's emotions directly. The mode of communication is a side-note. Tear down FB and none of this goes away - not because something rises from FB's ashes but because communication is a central facet of humanity.
You can plug into a happy room surrounded by your family and friends and it will be as though you are all together instead of thousands of miles apart. You can spend time with the children you miss, the grandchildren you hardly know, and it all comes for free.
You know that there will be commercials, of course, but that doesn't worry you too much. So what if every so often a handsome man comes in and tells you how delicious Coca Cola is? You've been around commercials before, you don't expect this time it will be much different.
But there are darker agencies at work. They suss out facts about your life, your joys, your fears, and they prey on them.
If you are a left-leaning person in a blue state they fill you with horror stories of religious fanatics who are determined to create a theocracy.
If you are a right-leaning person in a red state, they tell you of radicals who want to take away everything you've worked for and destroy everything you believe in.
It fits so neatly into what you already suspect that you never question it. Each new story becomes more and more outrageous, but you are a boiling frog at this point, you'll believe anything about 'the other side' no matter how outlandish.
So now you are a tool, a soldier, a person who can be manipulated in any way to support any cause as long as you believe that you are standing up to 'them'.
If it's not a PKD story, it should have been.
Should it be 'allowed'? I'll have to think on it.
You could do a lot of good with one of those! The ultimate anti-anxiety treatment, the ultimate in letting people become the cooler heads they need to be for good ideas to prevail in tense situations.
You could also hack into it with almost no effort and turn a whole city into a bad knock-off of Resident Evil; hit the neurons that rabies hits, get people tearing and biting at each other.
Should people be allowed to install it?
I think it's possible that books were a great idea and a machine like the one I described (without proper constraints to put control in the hands of the owner) would be a terrible idea. There's probably some technology along the line between these where we say "Whoa, wait. What this could achieve is grand, but the way it gets there is, uh-oh."
The more powerful a technology is, the more obligation it implies upon the people holding control over its implementation and execution to consider moral and philosophical concerns of its use.