Target Display Mode for Mid 2011 iMac and 2018 MacBook Pro
With a qualified iMac yes it should work, I was told this by Apple support. However there is a problem with the 2018 MBP and it does not. There is a large thread on this in the Apple forums:

https://discussions.apple.com/thread/8485517

Someone there recently figured out a workaround by daisychaining their iMac but we shouldn't have to buy more expensive devices to get it to work. Please report your issue to Apple support and make sure they escalate it to an engineer. Only by everyone reporting do we have a chance of getting this fixed.