I can drag a tab out of window, and it becomes independent window in Safari, Finder and other apps that support tabs. Is it possible to reverse this operation, convert window into tab by dragging it to another window?
Go to Window → Merge All Windows. In Safari, this merges other windows into the currently active window. In Finder, this merges the current windows into other window.
Alternatively, you can show the tab bar with View → Show Tab Bar. This lets you drag the tab when only one tab in a window is open.