It is quite easy with Magento 2, if your already have your module declared.
Let's imagine i want to add a "Clear Category Cache" button on Category Admin :

Admin buttons are declared in "UI Components" file, usually located in vendor/magento/MAGENTO_MODULE/view/adminhtml/ui_component\FILE.xml
.
For Categories, the file is located in vendor/magento/module-catalog/view/adminhtml/ui_component/category_form.xml
.
Let's create a copy in your module, to override the core one, in YOUR_NAMESPACE/YOUR_MODULE/view/adminhtml/ui_component/category_form.xml
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<settings>
<buttons>
<button name="clear_cache" class="YOUR_NAMESPACE\YOUR_MODULE\Block\Adminhtml\Category\Edit\ClearCacheButton"/>
</buttons>
</settings>
</form>
Finally, create your button file
<?php
namespace YOUR_NAMESPACE\YOUR_MODULE\Block\Adminhtml\Category\Edit;
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
use Magento\Catalog\Block\Adminhtml\Category\AbstractCategory;
/**
* Class ClearCacheButton
*/
class ClearCacheButton extends AbstractCategory implements ButtonProviderInterface
{
/**
* Clear Cache button
*
* @return array
*/
public function getButtonData()
{
$category = $this->getCategory();
$categoryId = (int)$category->getId();
if ($categoryId) {
return [
'id' => 'clear_cache',
'label' => __('Clear Category Cache'),
'on_click' => "alert('ok')",
'class' => 'delete',
'sort_order' => 10
];
}
return [];
}
}