Can you use a single partition for two different time machine backups?
Yes, the Time Machine system handles this automatically.

There's one major drawback in that you cannot decide on a storage quota for each backup. This means that if you have 1 TB of backup storage, you cannot decide that 500 GB is reserved for computer A and 500 GB for computer B.

So if the backup of one computer is too large, that could make it impossible to take a full backup of the other computer.

You can limit the size of a Time Machine backup though by executing on each Mac:

sudo defaults write /Library/Preferences/com.apple.TimeMachine MaxSize -integer size


with size in MB. Example:

sudo defaults write /Library/Preferences/com.apple.TimeMachine MaxSize -integer 500000