I am going to recommend that you use Server and Profile Manager as a reference implementation only. I strongly encourage against using it as a production solution. But first your questions.
• Can we use MacOS server in MacMini to centrally manage all devices?
Yes, you can. But there are really better options available as Apple is not providing much support for Server/Profile Manager and I fear the community is drying up. If something was to go wrong, you would likely be on your own.
• Do we need to configure MacMini with Public IP or it doesnt matter?
If the devices are outside the LAN (" laptops distributed around multiple countries") than access to the server must be provided somehow. However, placing it on a public address without any protection is probably not the best deployment. If deployed within your LAN, then simply use port forwarding to expose only the required ports (see https://support.apple.com/en-us/HT202487 for details). Also, DNS and an SSL certificate are critical. If you are going this route, you must understand DNS, fully qualified host names, and SSL certificates. This means that you will need to renew the SSL cert every year or two so add that to the cost of the implementation.
• Will devices be impacted if MacMini goes off line or need to keep it always on?
Not really. Unless the server is offline for an extended period of time or offline during your token renewal period (especially Push - don't let push cert expire or forgot which Apple ID was used to issue the Push cert). The simplified explanation of how MDM works is that a client will periodically ask the MDM server if there is any work to be done. This can be triggered by an agent or by receiving a push notification. If there are no notifications, the client does nothing. If the agent reaches out and can not connect to the MDM, the client does nothing.
• Do we need buy server app for all 40+ devices or only for administrators?
You only need one copy. There is no need to install on all devices.
If you are looking to manage your devices, consider what your management needs are and select a hosted MDM solution. Building your own using Server and Mac hardware is likely going to be a solution that you will not be able to support in the long run. You can look at Mosyle on the low end and go all the way up to Jamf Pro on the high end. At 50 devices, Jamf Pro may make sense, especially if you are looking to integrate with o365/Azure, have complex software requirements, and want the highest possible level of management. However, if you are looking to do inventory and a lot of profiles, then something like Mosyle might be a good fit.
My concerns with Server.app and Profile Manager is that Apple has demonstrated a clear deprecation of the Server.app product over the past few years. It currently provides OD, Xsan, and Profile Manager. But with the purchase of Fleetsmith, there is speculation that Apple may be moving its MDM offering to the Cloud which is a much more logical solution than an on-prem solution that is built on consumer grade hardware with no redundancy.
Hope this is helpful. Find a cloud partner for MDM. Don't roll this yourself.
Reid