Question: Suppose that person A booked today a hotel room for 3 nights in Dubai to travel in the upcoming February with Hotel Z (room price = 50€). In January, person A changed his mind about the visit and would cancel it. Person B, just realized that next week he has to be in Dubai, so he checked the price and found that room prices are almost 130€.

Is it possible for person A to sell his booking confirmation to person B? (Person A sell it for 70€ and person B can save up to 60€ and if there is hosting web service that carries this service, then it can take 10%)...

Will Hotel Z mind if such a thing happens? I am assuming that hotel policy is not violated by this kind of booking.

And how to make sure of this conduct is acceptable and could work?

Answer: 
Well...yes, it probably violates the terms in some way, especially if persons A and B are unrelated and otherwise unknown to each other.

However, most hotels are much looser about who uses a reservation than airlines so it's much more possible than not. Many (most?) actually accommodate this situation by allowing another name to be added for check-in in case that person arrives earlier then the one who made the booking.
You can resell your hotel reservation only if terms permits you to transfer the name on the booking (similar to plane tickets). Without a name transfer there is a risk that hotel won't able to check-in the person to prevent fraud. To avoid the surprise, it's good to confirm the terms with the hotel directly or just take the risk. See: [Hotel early arrival for another guest](https://travel.stackexchange.com/q/85851/2879)

There are several services that offer secondary markets to resell non-refundable travel tickets (similar to Craigslist, eBay or StubHub) such as *Hall St*, *Cancelon*, *ChangeYourFlight* and other similar. See: [New sites let you sell unused trips](http://www.bbc.com/travel/story/20121015-new-sites-let-you-sell-unused-trips).