Connect another mac as secondary display I have two macbooks:

MacBook Pro 2012
MacBook Pro 2017 with touchbar

Recently I've got an idea to use 2012 as a secondary display.
I don't completely understand whether it's possible or not, the only info I found on this is
https://www.macobserver.com/tips/how-to/imac-secondary-display/
It's said that this is possible if your second mac has thunderbolt or mini display ports. My 2012 does have it (mini display port).
So let's consider it's possible.
It's said I need mini display to usb-c adapter. It's ok but not quite cheap. So finally we reached my question.
I already have minidisplay to hdmi adapter. Now I'm wondering is it going to work if I purchase usb-c to hdmi adapter (since it's twice cheaper) and try to connect both adapters to each other?
No.
Unless explicitly mentioned in the official specifications for the machine, it can't.  For this machine it is https://support.apple.com/kb/sp649
You might find Synergy an interesting alternative as it allows you to use both machines at once.  https://symless.com/synergy